forked from 2023-Summer-Bootcamp-Team-B/RelaySketch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.main.yml
77 lines (70 loc) · 2.25 KB
/
docker-compose.main.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
version: "3.7"
services:
rabbitmq:
container_name: rabbitmq
image: rabbitmq:3.7.14-management-alpine
restart: always
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
django:
container_name: django
image: maaayreel/relaysketch-backend:latest
restart: always
depends_on:
- rabbitmq
environment: &common_env
SECRET_KEY: ${SECRET_KEY}
DB_DATABASE: ${DB_DATABASE}
DB_USERNAME: ${DB_USERNAME}
DB_HOST: ${DB_HOST}
DB_USER_PASSWORD: ${DB_USER_PASSWORD}
OPENAI_API_KEY: ${OPENAI_API_KEY}
NAVER_CLIENT_ID: ${NAVER_CLIENT_ID}
NAVER_CLIENT_SECRET: ${NAVER_CLIENT_SECRET}
AWS_ACCESS_KEY_ID: ${AWS_ACCESS_KEY_ID}
AWS_SECRET_ACCESS_KEY: ${AWS_SECRET_ACCESS_KEY}
AWS_STORAGE_BUCKET_NAME: ${AWS_STORAGE_BUCKET_NAME}
AWS_S3_REGION_NAME: ${AWS_S3_REGION_NAME}
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
AWS_REDIS_HOST: ${AWS_REDIS_HOST}
command: sh -c "/wait && pipenv run python manage.py collectstatic --no-input && pipenv run gunicorn -c gunicorn.conf.py config.asgi:application --bind 0.0.0.0:8000"
celery_worker:
container_name: celery_worker
image: maaayreel/relaysketch-backend:latest
restart: always
depends_on:
- django
- rabbitmq
environment:
<<: *common_env
command: sh -c "pipenv run celery -A config worker --loglevel=info"
celery_beat:
container_name: celery_beat
image: maaayreel/relaysketch-backend:latest
restart: always
depends_on:
- django
- rabbitmq
- celery_worker
environment:
<<: *common_env
command: sh -c "pipenv run celery -A config beat --loglevel=info"
frontend:
container_name: frontend
ports:
- "3000:3000"
image: maaayreel/relaysketch-frontend:latest
depends_on:
- django
certbot:
container_name: certbot
image: certbot/certbot
restart: unless-stopped
volumes:
- ./data/certbot/conf:/etc/letsencrypt
- ./data/certbot/www:/var/www/certbot
entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew; sleep 12h & wait $${!}; done;'"
volumes:
staticfiles: {}