-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathdocker-compose-local.yml
94 lines (94 loc) · 2.31 KB
/
docker-compose-local.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
90
91
92
93
94
version: "3.5"
services:
api:
build:
context: ./api
dockerfile: ../api.dockerfile
command:
- uvicorn
- app.main:app
- --host
- 0.0.0.0
- --port
- "80"
- --root-path
- /api
depends_on:
db:
condition: service_healthy
env_file:
- ./.env
environment:
- FIREBASE_AUTH_EMULATOR_HOST=firebase:9099 # use firebase auth emulator
labels:
- traefik.http.routers.api.entrypoints=http
- traefik.http.routers.api.priority=10
- traefik.http.routers.api.rule=PathPrefix(`/api`)
- traefik.http.routers.api.service=api
- traefik.http.routers.api.middlewares=api@docker
- traefik.http.middlewares.api.stripPrefix.prefixes=/api
- traefik.http.services.api.loadBalancer.server.port=80
restart: always
volumes:
- ./api/app:/app:ro
- ./api/app/alembic:/app/alembic:rw # for 'alembic revision --autogenerate'
- ./key:/key:ro
db:
image: postgres:14
command:
- postgres
# - -c
# - log_connections=on
- -c
- log_destination=stderr
# - -c
# - log_disconnections=on
- -c
- log_statement=all
environment:
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASSWORD}
restart: always
healthcheck:
test:
- CMD-SHELL
- pg_isready -U ${DB_USER}
interval: 10s
timeout: 5s
retries: 2
volumes:
- ./data:/var/lib/postgresql/data
traefik:
image: traefik:latest
depends_on:
- api
- web
ports:
- 80:80
- 8080:8080
restart: always
volumes:
- ./traefik:/etc/traefik
- /var/run/docker.sock:/var/run/docker.sock
web:
build:
context: ./web
dockerfile: ../web.dockerfile
labels:
- traefik.http.routers.web.entrypoints=http
- traefik.http.routers.web.priority=1
- traefik.http.routers.web.rule=PathPrefix(`/`)
restart: always
volumes:
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf
firebase:
build: ./firebase
ports:
- 4000:4000 # Emulator Suite UI
- 9099:9099 # Auth
volumes:
- ./firebase:/opt/workspace
working_dir: /opt/workspace
command: "firebase emulators:start --import=./data --export-on-exit"
tty: true
restart: always