-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-traefik-gunicorn-fastapi.yml
74 lines (73 loc) · 1.63 KB
/
docker-compose-traefik-gunicorn-fastapi.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
version: '3'
services:
traefik:
image: "traefik:v2.3"
container_name: "traefik"
command:
- "--api.insecure=true"
- "--providers.docker=true"
- "--providers.docker.exposedbydefault=false"
ports:
- "8008:80"
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
depends_on:
- intel
networks:
- traefik_intel_nw
- intel_db_nw
intel:
build:
context: ""
dockerfile: ./Dockerfile.intel
image: intel:latest
entrypoint:
- /bin/entrypoint.sh
env_file:
- intel.env
ports:
- "5678"
environment:
- VIRTUAL_HOST=intel
- VIRTUAL_PORT=5678
- SERVICE_PORT=5678
- PG_HOST=db
- PG_PORT=5432
- PG_DBNAME=postgres
- PG_USER=postgres
- PG_PASSWORD=postgres
- APP_NAME=traefik-gunicorn-fastapi
networks:
- intel_db_nw
- traefik_intel_nw
depends_on:
db:
condition: service_healthy
labels:
- "traefik.enable=true"
- "traefik.http.routers.intel.rule=hostregexp(`{host:.+}`)"
db:
restart: always
image: postgres:alpine
networks:
- intel_db_nw
ports:
- "5432"
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
volumes:
- ./init.sql:/docker-entrypoint-initdb.d/init.sql
- ./var/pgdata/intel:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U postgres" ]
interval: 5s
timeout: 5s
retries: 5
networks:
traefik_intel_nw:
driver: bridge
intel_db_nw:
driver: bridge