-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
74 lines (71 loc) · 1.56 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
65
66
67
68
69
70
71
72
73
74
# https://www.cloudbees.com/blog/using-docker-compose-for-nodejs-development
---
services:
dev:
container_name: groovebase_api_dev
build:
context: .
dockerfile: Dockerfile
target: dev
restart: always
depends_on:
postgres:
condition: service_healthy
volumes:
- ./:/usr/src/app
- node_modules_cache:/usr/src/app/node_modules/
ports:
- '3030:3030'
environment:
- host.docker.internal
command: 'npm run dev'
api-local-prod:
container_name: groovebase_api_local_prod
build:
context: .
dockerfile: Dockerfile
target: prod
restart: always
depends_on:
postgres:
condition: service_healthy
volumes:
- ./:/app
- node_modules_cache:/app/node_modules/
ports:
- '3030:3030'
environment:
- host.docker.internal
command: 'npm run prod'
postgres:
container_name: groovebase_db
image: postgres:latest
restart: always
environment:
- POSTGRES_HOST=postgres
- POSTGRES_PASSWORD=password
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PORT=5432
volumes:
- ./:/usr/src/app
- postgres_data:/var/lib/postgresql/data
ports:
- '5432:5432'
healthcheck:
test:
[
"CMD-SHELL",
"psql -U postgres",
"pg_isready",
"-d",
"postgres",
"|| exit 1"
]
interval: 2s
timeout: 30s
retries: 5
start_period: 15s
volumes:
node_modules_cache:
postgres_data: