-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocker-compose.yml
36 lines (32 loc) · 906 Bytes
/
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
version: '3'
services:
reverse-proxy:
image: traefik # The official Traefik docker image
command: --api --docker.exposedbydefault=false # Enables the web UI and tells Træfik to listen to docker, without exposing by default
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: mysql:5
restart: always
environment:
- MYSQL_ROOT_PASSWORD
- MYSQL_DATABASE
redis:
image: redis:alpine
app:
build: .
environment:
- DB_HOST=db
- DB_NAME=${MYSQL_DATABASE}
- DB_USER=root
- DB_PASSWORD=${MYSQL_ROOT_PASSWORD}
- REDIS_HOST=redis
labels:
- "traefik.enable=true"
- "traefik.frontend.rule=Host:${APP_HOST}"
depends_on:
- db
- redis