-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
68 lines (62 loc) · 1.75 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
version: '3.8'
services:
traefik:
image: "traefik:v2.5"
container_name: "traefik"
command:
#- "--log.level=DEBUG"
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
- "--entrypoints.web.address=:80"
- "--api"
ports:
- "80:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
frontend:
container_name: frontend
build:
context: ./frontend
dockerfile: Dockerfile
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
depends_on:
- backend
- db
labels:
- "traefik.enable=true"
# - "traefik.http.routers.frontend.rule=Host(`frontend.localhost`)"
# - "traefik.http.routers.frontend.entrypoints=web"
- "traefik.http.routers.frontend-http.rule=PathPrefix(`/`)"
- "traefik.http.services.frontend.loadbalancer.server.port=80"
backend:
container_name: backend
build: ./backend
command: uvicorn app.api.main:app --reload --workers 1 --host 0.0.0.0 --port 8000
env_file:
- ./backend/.env
# volumes:
# - ./backend:/usr/src/app
ports:
- 8000:8000
depends_on:
- db
labels:
- "traefik.enable=true"
# - "traefik.http.routers.backend.rule=Host(`api.localhost`)"
# - "traefik.http.routers.backend.entrypoints=web"
- "traefik.http.routers.backend-http.rule=PathPrefix(`/api`) || PathPrefix(`/docs`) || PathPrefix(`/redoc`)"
- "traefik.http.services.backend.loadbalancer.server.port=80"
db:
image: postgres:13.4-alpine
container_name: db
volumes:
- postgres_data:/var/lib/postgresql/data/
env_file:
- ./backend/.env
expose:
- 5432
volumes:
postgres_data: