-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yml
68 lines (63 loc) · 1.55 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
68
version: '3'
services:
db:
image: postgres:alpine
restart: always
labels:
- "traefik.enable=false"
networks:
- internal
volumes:
- ${PWD}/postgres-data:/var/lib/postgresql/data/
env_file: .env
environment:
- POSTGRES_PASSWORD=${DB_PASSWORD}
- POSTGRES_USER=${DB_USER}
- POSTGRES_DB=${DB_NAME}
django:
build: .
restart: always
networks:
- internal
volumes:
- ${PWD}/static:/code/static
- ${PWD}/TiAPI/migrations:/code/TiAPI/migrations
command: sh -c 'while !</dev/tcp/db/5432; do sleep 1; done'
labels:
- "traefik.enable=true"
env_file: .env
depends_on:
- db
- traefik
- nginx
traefik:
image: traefik:latest
restart: always
networks:
- internal
ports:
- 443:443
- 80:80
labels:
- "traefik.enable=true"
- "traefik.http.routers.http-catchall.rule=hostregexp(`{host:.+}`)"
- "traefik.http.routers.http-catchall.entrypoints=web"
- "traefik.http.routers.http-catchall.middlewares=redirect-to-https@docker"
- "traefik.http.middlewares.redirect-to-https.redirectscheme.scheme=https"
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ${PWD}/traefik:/etc/traefik:ro
nginx:
image: nginx:alpine
restart: always
networks:
- internal
volumes:
- ${PWD}/default.conf:/etc/nginx/conf.d/default.conf:ro
- ${PWD}/static:/static:ro
labels:
- "traefik.enable=true"
depends_on:
- traefik
networks:
internal: