-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdocker-compose.yml
46 lines (45 loc) · 1.19 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
version: '3.8'
services:
web:
build: ./services/app
command: [./start.sh]
volumes:
- ./services/app:/app/
- static_files:/app/static
- media_files:/app/media
expose:
- 8000
env_file:
- ./.env/web.env
depends_on:
- db
container_name: web
# Required to recognize the db alias on docker-compose up
restart: always
db:
image: postgres:14.2
env_file:
- ./.env/db.env
- ./.env/web.env
volumes:
# https://stackoverflow.com/questions/1510104/where-to-store-application-data-non-user-specific-on-linux
- postgres_data:/var/lib/postgresql/data
- ./services/db/:/docker-entrypoint-initdb.d/
container_name: postgres
restart: always
nginx:
build: ./services/nginx
ports:
- 80:80
- 443:443
volumes:
- static_files:/static
- media_files:/media_files
depends_on:
- web
container_name: nginx
restart: always
volumes:
postgres_data:
static_files:
media_files: