-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-prod.yml
128 lines (119 loc) · 2.62 KB
/
docker-compose-prod.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
version: "3.8"
services:
postgres:
image: postgres:15.3-alpine
hostname: ${DATABASE_HOST}
container_name: EDU
command: -p ${DATABASE_PORT} # Change the default port
env_file:
- ".env"
restart: always
volumes:
- postgres:/var/lib/postgresql/data
networks:
- postgres-network
redis:
image: redis:7.2.2-alpine
hostname: redis
container_name: redis
restart: always
networks:
- redis-network
minio:
image: minio/minio
hostname: "minio"
volumes:
- minio:/minio_files
env_file:
- ".env"
command: 'minio server /minio_files --console-address ":9001"'
ports:
- "9000:9000"
- "9001:9001"
# expose:
# - "9000"
restart: on-failure
networks:
- poxy-network
createbuckets:
image: minio/mc
depends_on:
- minio
env_file:
- ".env"
entrypoint: >
/bin/sh -c "
/usr/bin/mc config host add myminio http://minio:9000 ${MINIO_ROOT_USER} ${MINIO_ROOT_PASSWORD};
/usr/bin/mc mb --quiet myminio/photos;
/usr/bin/mc anonymous set none myminio/photos;
"
backend:
build:
context: .
command: >
/bin/sh -c "
./wait-for-it.sh postgres:${DATABASE_PORT} &&
poetry run python manage.py migrate &&
poetry run python manage.py collectstatic --no-input &&
poetry run gunicorn EDU.wsgi:application --bind 0.0.0.0:8000
"
volumes:
- ./:/usr/src/app/
- ./staticfiles:/usr/src/app/staticfiles
- ./mediafiles:/usr/src/app/mediafiles
environment:
- DJANGO_DATABASE_HOST=postgres
- CACHE_ENDPOINT=redis
depends_on:
- postgres
- redis
networks:
- poxy-network
- postgres-network
- redis-network
proxy:
image: nginx
volumes:
- ./staticfiles:/home/app/staticfiles
- ./mediafiles:/home/app/mediafiles
- type: bind
source: ./proxy/nginx.conf
target: /etc/nginx/conf.d/default.conf
read_only: true
ports:
- '80:80'
# - '9003:9003'
depends_on:
- backend
networks:
- poxy-network
# celery:
# build: .
# command: celery -A EDU worker --loglevel=info
# depends_on:
# - redis
# - backend
# volumes:
# - .:/usr/src/app/
# networks:
# - redis-network
#
# flower:
# build: .
# command: celery -A EDU flower
# depends_on:
# - redis
# - celery
# networks:
# - redis-network
# ports:
# - '5555:5555'
# volumes:
# - .:/usr/src/app/
volumes:
postgres:
minio:
networks:
poxy-network:
postgres-network:
redis-network: