-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
144 lines (131 loc) · 3.52 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
139
140
141
142
143
144
version: "3.7"
x-backend-environment: &base-backend-environment
- SECRET_KEY=${SECRET_KEY}
- DEBUG=${DEBUG}
- DEBUG_SQL=${DEBUG_SQL}
- HOST_SITE=${HOST_SITE}
- ADMIN_DIR=${ADMIN_DIR}
- POSTGRES_DB=trcustoms
- POSTGRES_USER=root
- POSTGRES_PASSWORD=root
- AWS_ACCESS_KEY_ID
- AWS_SECRET_ACCESS_KEY
- AWS_STORAGE_BUCKET_NAME
- AWS_S3_ENDPOINT_URL
- AWS_S3_CUSTOM_DOMAIN
- USE_AWS_STORAGE
- EMAIL_HOST
- EMAIL_PORT
- EMAIL_HOST_USER
- EMAIL_HOST_PASSWORD
- EMAIL_USE_TLS
- EMAIL_USE_SSL
x-base-trcustoms: &base-trcustoms
restart: unless-stopped
x-base-trcustoms-backend: &base-trcustoms-backend
<<: *base-trcustoms
environment: *base-backend-environment
build:
context: .
dockerfile: ./services/backend/Dockerfile
volumes:
- ./backend/trcustoms/:/app/trcustoms/
- ./backend/volumes/cache/:/app/cache/
- ./backend/volumes/uploads/:/app/uploads/
- ./backend/volumes/django_static/:/app/django_static/
- ./services/backend/entrypoint.sh:/usr/local/bin/entrypoint.sh
- ./pyproject.toml:/pyproject.toml
networks:
- trcustoms
depends_on:
- trcustoms-redis
- trcustoms-db
- trcustoms-mailhog
services:
trcustoms:
<<: *base-trcustoms-backend
command: dev
trcustoms-celery:
<<: *base-trcustoms-backend
command: celery
trcustoms-celery-beat:
<<: *base-trcustoms-backend
command: celery-beat
trcustoms-frontend:
<<: *base-trcustoms
restart: unless-stopped
build:
context: .
dockerfile: ./services/frontend/Dockerfile
environment:
- REACT_APP_HOST_SITE=${HOST_SITE}
volumes:
- ./frontend/public/:/app/public/
- ./frontend/src/:/app/src/
- ./frontend/tsconfig.json:/app/tsconfig.json
- ./frontend/package.json:/app/package.json
- ./services/frontend/entrypoint.sh:/usr/local/bin/entrypoint.sh
networks:
- trcustoms
depends_on:
- trcustoms
command: dev
ports:
- "3000:3000"
trcustoms-db:
<<: *base-trcustoms
image: postgres:14.0
environment: *base-backend-environment
expose:
- 5432
volumes:
- ./backend/volumes/pgdata:/var/lib/postgresql/data
networks:
- trcustoms
trcustoms-redis:
<<: *base-trcustoms
image: redis:6
expose:
- 6379
networks:
- trcustoms
trcustoms-nginx:
<<: *base-trcustoms
image: nginx
environment: *base-backend-environment
volumes:
- ./services/nginx/nginx_prerender_map.conf:/etc/nginx/nginx_prerender_map.conf:ro
- ./services/nginx/nginx_prerender_server.conf:/etc/nginx/nginx_prerender_server.conf:ro
- ./services/nginx/nginx_dev.conf.template:/etc/nginx/nginx.conf.template:ro
- ./backend/volumes/uploads/:/app/uploads/
- ./backend/volumes/django_static/:/app/django_static/
networks:
- trcustoms
ports:
- mode: host
protocol: tcp
published: ${TRCUSTOMS_PORT}
target: 8000
depends_on:
- trcustoms
command: /bin/bash -c 'envsubst "\$${ADMIN_DIR}" < /etc/nginx/nginx.conf.template > /etc/nginx/nginx.conf && nginx -g "daemon off;"'
trcustoms-prerender:
<<: *base-trcustoms-backend
build:
context: ./services/prerender/
volumes:
- ./services/prerender/plugins/:/app/plugins/
- ./services/prerender/server.js:/app/server.js
networks:
- trcustoms
trcustoms-mailhog:
image: mailhog/mailhog:v1.0.0
expose:
- 1025
networks:
- trcustoms
ports:
- "8025:8025"
networks:
trcustoms:
external: false