-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
54 lines (48 loc) · 1.13 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
# docker-compose.yml
version: '3.3'
services:
agent:
build: .
command: python app/agent.py
volumes:
- ./app/logs:/fec/app/logs
expose:
- 8000
environment:
- DATABASE_URL=${DATABASE_URL}
depends_on:
- db
api:
build: .
command: bash -c 'while !</dev/tcp/db/5432; do sleep 1; done; uvicorn app.main:app --host 0.0.0.0'
volumes:
- ./app/logs:/fec/app/logs
expose:
- 8000
environment:
- DATABASE_URL=postgresql://fec_db:fec_db@db:5432/fec_db
depends_on:
- db
labels:
- "traefik.enable=true"
- "traefik.http.routers.fastapi.rule=Host(`ec2-35-81-83-141.us-west-2.compute.amazonaws.com`)"
db:
image: postgres:13-alpine
volumes:
- ./.postgres:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_USER=fec_db
- POSTGRES_PASSWORD=fec_db
- POSTGRES_DB=fec_db
traefik:
image: traefik:v2.2
ports:
- 8008:80
- 8081:8080
volumes:
- "./traefik.dev.toml:/etc/traefik/traefik.toml"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
volumes:
postgres_data: