-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
138 lines (127 loc) · 3.47 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
services:
django:
build:
context: ./django
dockerfile: Dockerfile
args:
EMAIL_HOST: ${EMAIL_HOST}
EMAIL_HOST_USER: ${EMAIL_HOST_USER}
EMAIL_HOST_PASSWORD: ${EMAIL_HOST_PASSWORD}
GCS_BUCKET_NAME: ${GCS_BUCKET_NAME}
container_name: django
command: ["poetry", "run", "gunicorn", "--timeout", "600", "spatiallab.wsgi:application", "--bind", "0.0.0.0:8080"]
volumes:
- ./django:/app
environment:
- DEBUG=True
- DB_PASSWORD=${POSTGRES_PASSWORD}
- DB_USER=${POSTGRES_USER}
- DJANGO_SETTINGS_MODULE=spatiallab.settings
- DATABASE_URL=postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
- CELERY_BROKER_URL=pyamqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@rabbitmq:5672//
- REDIS_URL=redis://redis:6379/1
- DJANGO_ALLOWED_HOSTS=localhost,spatiallab.app
- GCS_BUCKET_NAME=${GCS_BUCKET_NAME}
expose:
- "8080"
depends_on:
- postgres
postgres:
image: postgis/postgis:latest
container_name: postgres
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- postgres_data:/var/lib/postgresql/data
react:
build:
context: ./react
args:
NEXT_PUBLIC_PROTOCOL: ${NEXT_PUBLIC_PROTOCOL}
NEXT_PUBLIC_ROOT_URL: ${NEXT_PUBLIC_ROOT_URL}
NEXT_PUBLIC_API_URL: ${NEXT_PUBLIC_API_URL}
NEXT_PUBLIC_TILESERV_URL: ${NEXT_PUBLIC_TILESERV_URL}
container_name: react
volumes:
- ./react:/app
- /app/node_modules
- /app/.next
ports:
- "3000:3000"
depends_on:
- django
environment:
NODE_ENV: production
rabbitmq:
image: rabbitmq:management
container_name: rabbitmq
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq_data:/var/lib/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_PASSWORD}
celery:
build:
context: ./django
container_name: celery
command: ["celery", "-A", "spatiallab", "worker", "--loglevel=info"]
volumes:
- ./django:/app
depends_on:
- django
- rabbitmq
environment:
- CELERY_BROKER_URL=pyamqp://${RABBITMQ_USER}:${RABBITMQ_PASSWORD}@rabbitmq:5672//
- REDIS_URL=redis://redis:6379/1
pg_tileserv:
build: ./pg_tileserv
environment:
- PGHOST=postgres
- PGUSER=${POSTGRES_USER}
- PGPASSWORD=${POSTGRES_PASSWORD}
- PGDATABASE=${POSTGRES_DB}
- PGPORT=5432
jenkins:
image: jenkins/jenkins:lts
container_name: jenkins
ports:
- "8081:8080"
volumes:
- jenkins_home:/var/jenkins_home
nginx:
image: nginx:latest
container_name: nginx
ports:
- "80:80"
- "443:443"
volumes:
- ./nginx/nginx.conf:/etc/nginx/nginx.conf
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
depends_on:
- django
- react
restart: always
redis:
image: redis:6.0-alpine
container_name: redis_cache
ports:
- "6379:6379"
volumes:
- redis_data:/data
certbot:
image: certbot/certbot
volumes:
- ./certbot/conf:/etc/letsencrypt
- ./certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do sleep 6h & wait $!; certbot renew; done;'"
volumes:
postgres_data:
rabbitmq_data:
jenkins_home:
redis_data: