-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-compose.yml
80 lines (72 loc) · 1.73 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
version: '3.3'
volumes:
postgres_data:
static_data:
media_data:
services:
db:
image: postgres:13.0-alpine
container_name: ecommerce-db
env_file: .env
volumes:
- postgres_data:/var/lib/postgresql/data
restart: always
backend:
build: ./core
container_name: ecommerce-backend
env_file: .env
volumes:
- static_data:/app/static
- media_data:/app/media
depends_on:
- db
ports:
- 8000:8000
links:
- db
restart: always
command: sh -c "python manage.py makemigrations &&
python manage.py migrate &&
python manage.py collectstatic --noinput &&
gunicorn project.wsgi:application --bind 0.0.0.0:8000 &&
stripe listen --forward-to localhost:8000/payment/webhook-stripe/"
develop:
watch:
- action: rebuild
path: .
redis:
image: redis:7.2.3-alpine
container_name: ecommerce-redis
restart: unless-stopped
celery:
build: ./core
container_name: ecommerce-celery
env_file: .env
depends_on:
- db
- redis
volumes:
- static_data:/app/static
restart: always
command: celery -A project worker --loglevel=info
celery-beat:
build: ./core
container_name: ecommerce-celery-beat
env_file: .env
depends_on:
- db
- redis
volumes:
- static_data:/app/static
restart: always
command: python -m celery -A project beat --loglevel=info
nginx:
image: nginx:latest
container_name: ecommerce-nginx
volumes:
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
- static_data:/app/static
- media_data:/app/media
ports:
- 80:80
restart: always