-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
executable file
·71 lines (66 loc) · 1.4 KB
/
docker-compose.yml
File metadata and controls
executable file
·71 lines (66 loc) · 1.4 KB
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
version: "3"
services:
# PostgreSQL
db:
image: postgres:10.5
hostname: db
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- "5432:5432"
# Redis
redis:
image: redis:4.0.11
hostname: redis
ports:
- "6379:6379"
# Django
django:
build:
context: .
dockerfile: Dockerfile
hostname: django
command: ["./wait-for-postgres.sh", "db", "./entrypoint.sh"]
volumes:
- ./src:/app
- ./entrypoint.sh:/app/entrypoint.sh
- ./wait-for-postgres.sh:/app/wait-for-postgres.sh
depends_on:
- db
restart: always
# Celery
worker:
environment:
- C_FORCE_ROOT=true
build:
context: .
dockerfile: Dockerfile
command: ["./entrypoint_celery.sh"]
volumes:
- ./src:/app
- ./entrypoint_celery.sh:/app/entrypoint_celery.sh
depends_on:
- django
- redis
restart: always
# Nginx
web-nginx:
environment:
- SERVER_NAME=MY_SERVER_NAME
image: nginx:1.15.5
hostname: nginx
restart: always
environment:
UPSTREAM: django:8000
SERVERNAME: ${SERVER_NAME}
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf
- ./cert.crt:/etc/nginx/ssl/certificate.crt
- ./cert.key:/etc/nginx/ssl/certificate.key
depends_on:
- django