-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
44 lines (37 loc) · 1.24 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
version: '3'
services:
# The reverse proxy service (Træfik)
traefik:
image: traefik # The official Traefik docker image
command: --api --docker --logLevel=INFO # Enables the web UI and tells Træfik to listen to docker
ports:
- "80:80" # The HTTP port
- "8080:8080" # The Web UI (enabled by --api)
volumes:
- /var/run/docker.sock:/var/run/docker.sock # So that Traefik can listen to the Docker events
db:
image: postgres:9.6.5-alpine
environment:
POSTGRES_DB: traefikauth
POSTGRES_USER: traefikauth
POSTGRES_PASSWORD: traefikauth
volumes:
- db_data:/var/lib/postgresql/data
auth:
image: buluba89/traefik-simple-auth
build: ./
depends_on:
- db
environment:
DATABASE_URL: postgres://traefikauth:traefikauth@db:5432/traefikauth
DOMAINS: .docker.localhost
labels:
- "traefik.frontend.rule=Host:auth.docker.localhost"
# A container that exposes a simple API
whoami:
image: emilevauge/whoami # A container that exposes an API to show it's IP address
labels:
- "traefik.frontend.rule=Host:whoami.docker.localhost"
- "traefik.frontend.auth.forward.address=http://auth.docker.localhost/auth/"
volumes:
db_data: