forked from BretFisher/nodejs-rocks-in-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
44 lines (41 loc) · 1.01 KB
/
compose.yaml
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
###
## for local dev, wait for db to pass healthcheck before we start node
## also, build custom dockerfile to the dev stage
###
# version key is DEPRECATED
# v2 and v3 features now combined in compose CLI
services:
node:
build:
dockerfile: dockerfiles/3.Dockerfile
context: .
# build to the stage named dev
target: dev
# Not needed when `develop: watch` is used
# volumes:
# - .:/app
ports:
# use docker compose ps to see which host port is used
- "3000"
depends_on:
db:
condition: service_healthy
develop:
watch:
- action: sync
path: ./
target: /app
- action: rebuild
path: package.json
- action: rebuild
path: package-lock.json
db:
image: postgres:alpine
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
volumes:
- ./healthchecks:/healthchecks
healthcheck:
test: /healthchecks/postgres-healthcheck
interval: "5s"