-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
89 lines (83 loc) · 2.19 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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
version: "3.7"
services:
backend:
command: uvicorn jeopardy.app:app --host=0.0.0.0 --reload
build:
context: .
target: jeopardy_backend
depends_on:
- database
env_file:
- .env
environment:
DATABASE_URI: "mysql://web:web_password@database:3306/jeopardy"
labels:
traefik.enable: "true"
traefik.http.routers.api.rule: "PathPrefix(`/api`)"
traefik.http.routers.api.entrypoints: "http"
traefik.http.routers.auth.rule: "PathPrefix(`/user`)"
traefik.http.routers.auth.entrypoints: "http"
traefik.http.routers.health.rule: "Path(`/health-check`)"
traefik.http.routers.health.entrypoints: "http"
traefik.http.services.backend.loadbalancer.server.port: "8000"
ports:
- 8000:8000
volumes:
- ./backend:/app
- ./database:/database
database:
image: mysql:5.7
environment:
MYSQL_DATABASE: "jeopardy"
MYSQL_USER: "web"
MYSQL_PASSWORD: "web_password"
MYSQL_ROOT_PASSWORD: "root_password"
ports:
- 3305:3306
frontend:
build:
context: ./frontend
depends_on:
- backend
env_file:
- .env
labels:
traefik.enable: "true"
traefik.http.routers.frontend.rule: "PathPrefix(`/`)"
traefik.http.routers.frontend.entrypoints: "http"
traefik.http.services.frontend.loadbalancer.server.port: "8080"
volumes:
- ./frontend:/frontend
ingress:
image: traefik:v2.2
depends_on:
- backend
- frontend
- docker-socket
environment:
TRAEFIK_API_INSECURE: "true"
TRAEFIK_ENTRYPOINTS_HTTP_ADDRESS: ":80"
TRAEFIK_PROVIDERS_DOCKER: "true"
TRAEFIK_PROVIDERS_DOCKER_ENDPOINT: "tcp://docker-socket:2375"
TRAEFIK_PROVIDERS_DOCKER_EXPOSEDBYDEFAULT: "false"
TRAEFIK_LOG_LEVEL: "INFO"
networks:
- default
- secure-docker-socket
ports:
- 8080:8080
- 80:80
- 443:443
docker-socket:
image: tecnativa/docker-socket-proxy
environment:
CONTAINERS: 1
networks:
- secure-docker-socket
ports:
- 2375
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
networks:
secure-docker-socket:
external: true