-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose-migrate-dev.yml
50 lines (48 loc) · 1.4 KB
/
docker-compose-migrate-dev.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
version: "3"
services:
backend_django:
image: backend_django
build:
# docker build 명령을 실행할 directory 경로
context: .
environment:
- POSTGRES_DB=${LOCAL_DB_NAME}
- POSTGRES_USER=${LOCAL_DB_USER}
- POSTGRES_PASSWORD=${LOCAL_DB_PASSWORD}
- POSTGRES_HOST=${LOCAL_DB_HOST}
- POSTGRES_PORT=${LOCAL_DB_PORT}
- REDIS_HOST=${LOCAL_REDIS_HOST}
- REDIS_PORT=${LOCAL_REDIS_PORT}
- REDIS_DATABASE=${LOCAL_REDIS_DB}
depends_on:
- postgres
- redis
restart:
always
volumes:
- ./mini_mall:/mini_mall
ports:
- "8000:8000"
command: >
sh -c "python /mini_mall/manage.py makemigrations --settings=config.settings.dev &&
python /mini_mall/manage.py migrate --settings=config.settings.dev &&
python /mini_mall/manage.py runserver 0.0.0.0:8000 --settings=config.settings.dev"
postgres:
image: postgres:13
environment:
- POSTGRES_DB=${LOCAL_DB_NAME}
- POSTGRES_USER=${LOCAL_DB_USER}
- POSTGRES_PASSWORD=${LOCAL_DB_PASSWORD}
- POSTGRES_INITDB_ARGS=--encoding=UTF-8
volumes:
- postgres-data:/var/lib/postgresql/data
ports:
- ${LOCAL_DB_PORT}:${LOCAL_DB_PORT}
redis:
image: redis:latest
ports:
- ${LOCAL_REDIS_PORT}:${LOCAL_REDIS_PORT}
command: redis-server --save ""
volumes:
postgres-data:
driver: local