-
Notifications
You must be signed in to change notification settings - Fork 2
/
docker-compose.yml
85 lines (82 loc) · 2.18 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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
version: '3.7'
services:
django_wsgi:
build: ./pos
image: pudapos:${VERSION}
command: gunicorn puda.wsgi:application --bind 0.0.0.0:8000
restart: unless-stopped
volumes:
- static_volume:/usr/src/pos/static/
- media_volume:/usr/src/pos/media/
depends_on:
- db
networks:
- puda
env_file:
- .env
environment:
- DJANGO_TASKS=yes
django_asgi:
build: ./pos
image: pudapos:${VERSION}
command: daphne -b 0.0.0.0 -p 8000 puda.asgi:application
restart: unless-stopped
volumes:
- media_volume:/usr/src/pos/media/
depends_on:
- db
- redis
networks:
- puda
env_file:
- .env
environment:
- DJANGO_TASKS=no
db:
image: postgres:12.0-alpine
restart: unless-stopped
volumes:
- postgres_data:/var/lib/postgresql/data/
environment:
- POSTGRES_USER=puda
- POSTGRES_PASSWORD=puda
- PUSTGRES_DB=puda
networks:
- puda
nginx:
build: ./nginx
image: pudapos-nginx-proxy:${VERSION}
restart: unless-stopped
volumes:
- static_volume:/var/www/static/
depends_on:
- django_wsgi
- django_asgi
networks:
- puda
- proxy
labels:
- "traefik.enable=true"
- "traefik.http.routers.${TRAEFIK_NAME}_insecure.rule=Host(`${HOST}`)"
- "traefik.http.routers.${TRAEFIK_NAME}_insecure.entrypoints=http"
- "traefik.http.routers.${TRAEFIK_NAME}_insecure.middlewares=traefik-https-redirect"
- "traefik.http.routers.${TRAEFIK_NAME}_insecure.service=${TRAEFIK_NAME}"
- "traefik.http.routers.${TRAEFIK_NAME}.rule=Host(`${HOST}`)"
- "traefik.http.routers.${TRAEFIK_NAME}.entrypoints=https"
- "traefik.http.routers.${TRAEFIK_NAME}.tls.certresolver=http"
- "traefik.http.routers.${TRAEFIK_NAME}.service=${TRAEFIK_NAME}"
- "traefik.http.services.${TRAEFIK_NAME}.loadbalancer.server.port=80"
- "traefik.http.services.${TRAEFIK_NAME}.loadbalancer.server.scheme=http"
redis:
image: redis:alpine
restart: unless-stopped
networks:
- puda
volumes:
postgres_data:
static_volume:
media_volume:
networks:
puda:
proxy:
external: true