This project sets up a simple Flask application (myapp
) behind a Traefik reverse proxy with basic authentication.
- Docker and Docker Compose installed.
├── Dockerfile
├── docker-compose.yml
└── app.py
- Traefik Service: Routes traffic, exposes ports 80 (HTTP) and 8080 (dashboard).
- MyApp Service: Flask application with Traefik routing and basic authentication for users
test
andtest2
.
A simple Flask app with one route:
/home
: Returns a welcome message.
- Base image:
python:3.8-slim-buster
. - Installs Flask and exposes port 4000.
-
Clone the repository:
git clone <repository-url> cd myapp
-
Build and run:
docker-compose up --build
-
Access the Traefik dashboard at
http://localhost:8080
.
Visit http://example.com/home
in your browser. Basic authentication is required.