-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
51 lines (49 loc) · 1.54 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
version: '3.7'
# docker-compose up --build (시작 전에 DB를 위해 back서비스의 env파일 수정할 것)
# docker-compose down(프론트 앱 업데이트를 위해 front_app volume은 제거할 것)
# volume은 처음 생성 시, 해당 볼륨으로 접근하는 최초 컨테이너에 한해서만 데이터가 업데이트 되기 때문
# 즉, 프론트앱 볼륨이 잔류할 시 다음 빌드 배포에 대해 볼륨 내부 데이터는 업데이트 되지 않음
# 반대로 postgres가 데이터 저장을 위해 사용하는 볼륨은 절대 지우면 안되겠지;;;
services:
psql:
image: postgres:12.4-alpine
restart: always
volumes:
- psql_data:/var/lib/postgresql/data/
env_file:
- ./postgres.env
front:
build:
context: ./front
volumes:
- front_app:/front/build
env_file:
- ./front/.env
back:
build:
context: ./back
restart: always
env_file:
- ./back/.env
depends_on:
- psql
nginx:
image: nginx:latest
restart: always
ports:
- 80:8080
volumes:
# - /etc/nginx/ssl/: /etc/nginx/ssl/
- front_app:/var/www/front/
- ./nginx/freechart.conf:/etc/nginx/conf.d/default.conf:ro
depends_on:
- back
- front
redis:
image: "redis:alpine"
restart: always
ports:
- 6379:6379
volumes:
psql_data:
front_app: