generated from fanatic75/nestjs-starter-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
46 lines (46 loc) · 1.03 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
services:
app:
image: "node:20-alpine"
container_name: "emailer-service"
restart: on-failure
build:
context: .
dockerfile: Dockerfile
networks:
- my-network
ports:
- "3000:3000"
volumes:
- .:/usr/src/app
- app-node-modules:/usr/src/app/node_modules
environment:
NODE_ENV: ${NODE_ENV:-development}
PORT: ${PORT:-3000}
DATABASE_URL: ${DATABASE_URL:-postgres://postgres:password@db:5432/postgres}
depends_on:
db:
condition: service_healthy
db:
image: postgres
container_name: "predict-db"
restart: on-failure
networks:
- my-network
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 5s
timeout: 5s
retries: 5
volumes:
- db-data:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${DB_USER:-postgres}
POSTGRES_PASSWORD: ${DB_PASSWORD:-password}
networks:
my-network:
driver: bridge
volumes:
db-data:
app-node-modules: