-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-build.yml
63 lines (57 loc) · 1.45 KB
/
docker-compose-build.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
services:
app:
container_name: app
build:
context: .
restart: always
volumes:
- static:/vol/web
expose:
- "9090"
environment:
- DB_HOST=db
- DB_NAME=${DB_NAME}
- DB_USER=${DB_USER}
- DB_PASS=${DB_PASS}
- SECRET_KEY=${SECRET_KEY}
- ALLOWED_HOSTS=${ALLOWED_HOSTS}
- DEV=false
labels:
- "traefik.enable=true"
- "traefik.docker.network=web"
- "traefik.http.routers.app1.rule=Host(`${BASE_APP_DOMAIN}`)"
- "traefik.http.services.app1.loadbalancer.server.port=9090"
- "traefik.http.routers.app1.entrypoints=web"
- "traefik.http.routers.app1.entrypoints=websecure"
- "traefik.http.routers.app1.tls=true"
- "traefik.http.routers.app1.middlewares=redirect-to-https@docker,rate-limit@docker"
- "traefik.http.routers.app1.tls.certresolver=letsencrypt"
networks:
- web
- backend
depends_on:
- db
db:
image: postgres:16.0-alpine3.18
restart: always
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_DB=${DB_NAME}
- POSTGRES_USER=${DB_USER}
- POSTGRES_PASSWORD=${DB_PASS}
- PORT=${DB_PORT}
healthcheck:
test: ["CMD-SHELL", "pg_isready -q -d $$POSTGRES_DB -U $$POSTGRES_USER"]
interval: 5s
timeout: 5s
retries: 5
networks:
- backend
volumes:
postgres-data:
static:
networks:
web:
external: true
backend: