forked from bunderLikeLion/sellon_backend
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
64 lines (63 loc) · 1.59 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
version: '3'
services:
webapp: &webapp
env_file:
- ./.env
volumes:
- ./webapp:/usr/src/app
- staticfiles:/usr/src/app/static
- mediafiles:/usr/src/app/media
- ./logs:/usr/src/app/logs
build:
context: ./webapp
dockerfile: ./Dockerfile
image: webapp-dev-image
container_name: webapp-dev-container
command: >
bash -c "python ./manage.py makemigrations --noinput &&
python ./manage.py migrate --noinput &&
python ./manage.py collectstatic --noinput &&
python ./manage.py runserver 0.0.0.0:8888"
depends_on:
- db
restart: always
nginx:
build:
context: ./nginx
dockerfile: ./Dockerfile
image: nginx-dev-image
container_name: nginx-dev-container
ports:
- 8888:80
depends_on:
- webapp
- db
entrypoint:
- /docker-entrypoint.sh
links:
- webapp
volumes:
- staticfiles:/static
- mediafiles:/media
- ./logs:/var/log/nginx
restart: always
db:
image: postgres
expose:
- "${POSTGRES_PORT}"
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
environment:
- POSTGRES_HOST_AUTH_METHOD=trust
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_PORT=${POSTGRES_PORT}
volumes:
- ./db/initial_setup.sql:/docker-entrypoint-initdb.d/initial_setup.sql
- postgres_data:/var/lib/postgresql/data/
command: -p ${POSTGRES_PORT}
volumes:
postgres_data:
staticfiles:
mediafiles: