-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
77 lines (76 loc) · 1.72 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
version: '3.8'
services:
shopdb:
image: postgres:14
container_name: postgres-shop
env_file:
- ./.env
command: -p 5431
networks:
testnet:
ipv4_address: 172.26.0.6
volumes:
- django_musicshop_db:/var/lib/postgresql/data
ports:
- 5431:5431
expose:
- 5431
shop:
build: .
container_name: musicshop
volumes:
- static_django_shop:/musicshop/staticfiles
- media_django_shop:/musicshop/media
shop_migrate:
extends:
service: shop
container_name: 'shop_migrate'
command: >
/bin/sh -c "python3 manage.py migrate --force-color -v 3
&& python3 manage.py loaddata user/fixtures/user.json cart/fixtures/cart.json product/fixtures/product.json
&& python3 manage.py collectstatic"
networks:
testnet:
ipv4_address: 172.26.0.10
shop_run:
extends:
service: shop_migrate
container_name: 'shop_run'
command: gunicorn shop.wsgi:application --bind 0.0.0.0:7000
networks:
testnet:
ipv4_address: 172.26.0.7
expose:
- 7000
redis_cache:
image: redis
container_name: redis-django-shop
ports:
- 6371:6371
command: --port 6371
networks:
testnet:
ipv4_address: 172.26.0.8
nginx_shop:
build: ./nginx
container_name: nginx-django-shop
volumes:
- static_django_shop:/musicshop/staticfiles
- media_django_shop:/musicshop/media
networks:
testnet:
ipv4_address: 172.26.0.9
ports:
- 1336:80
depends_on:
- shop_run
networks:
testnet:
external: True
volumes:
static_django_shop:
external: True
media_django_shop:
external: True
django_musicshop_db:
external: True