-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
45 lines (45 loc) · 943 Bytes
/
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
version: '3.8'
services:
api:
build:
context: '.'
dockerfile: './backend/Dockerfile'
container_name: 'api'
volumes:
- './backend:/usr/src/app'
ports:
- '${API_PORT:-4000}:4000'
command: 'npm run dev:watch'
depends_on:
- 'db'
db:
image: 'postgres:13-alpine'
container_name: 'postgres'
volumes:
- 'db_data:/var/lib/postgresql/data'
environment:
POSTGRES_PASSWORD: '${DB_PASSWORD}'
TZ: 'Asia/Tokyo'
ports:
- '${DB_PORT:-5432}:5432'
nextjs:
build:
context: '.'
dockerfile: './Dockerfile'
container_name: 'nextjs'
volumes:
- './frontend:/usr/src/app'
ports:
- '${NEXT_PORT:-3000}:3000'
command: 'npm run dev'
depends_on:
- 'api'
- 'db'
- 'nginx'
nginx:
image: 'nginx:1.18.0-alpine'
container_name: 'nginx'
ports:
- '${NGINX_PORT:-80}:80'
volumes:
db_data: