generated from lawalletio/module-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
50 lines (50 loc) · 1.2 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
version: "3.8"
services:
postgres:
container_name: massacre_postgres
image: postgres:15
restart: always
environment:
DATABASE_HOST: localhost
POSTGRES_USER: root
POSTGRES_PASSWORD: massacre
POSTGRES_DB: halving-massacre
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -U root -h localhost -d halving-massacre"
]
interval: 5s
timeout: 5s
retries: 5
start_period: 360s
massacre-migrate:
image: node:18-alpine3.16
container_name: massacre-migrate
environment:
DATABASE_URL: postgresql://root:massacre@massacre_postgres/halving-massacre
entrypoint:
[
'sh',
'-c',
'cd code && npm install --no-save --quiet [email protected] && npx prisma migrate deploy'
]
volumes:
- ./prisma:/code/prisma
depends_on:
postgres:
condition: service_healthy
app:
container_name: halving-massacre
restart: always
build:
context: ./
target: runner
env_file:
- ./.env
environment:
NODE_ENV: production
DATABASE_URL: "postgresql://root:massacre@postgres:5432/halving-massacre"
depends_on:
- postgres