forked from argotorg/sourcify
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.local.yml
More file actions
48 lines (45 loc) · 1.19 KB
/
docker-compose.local.yml
File metadata and controls
48 lines (45 loc) · 1.19 KB
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
version: "3.8"
services:
db:
image: postgres:15-alpine
environment:
POSTGRES_DB: "sourcify"
POSTGRES_USER: "sourcify"
POSTGRES_PASSWORD: "sourcify"
ports:
- 5431:5432
healthcheck:
test: ["CMD-SHELL", "pg_isready"]
interval: 10s
timeout: 5s
retries: 5
# Needed to separate the migration because node must have PID 1 in service server
run-migrations:
image: node:22.5.1-bookworm-slim
volumes:
- ../database:/home/app/services/database
environment:
DATABASE_URL: "postgres://sourcify:sourcify@db:5432/sourcify?sslmode=disable"
command: /bin/bash -c "cd /home/app/services/database && npm install && npm run migrate:up"
restart: "no"
deploy:
restart_policy:
condition: none
depends_on:
db:
condition: service_healthy
server:
build:
context: ../..
dockerfile: services/server/Dockerfile
ports:
- "5555:5555"
env_file:
- .env
volumes:
- ./src/config/local.js:/home/app/services/server/dist/config/local.js
depends_on:
db:
condition: service_started
run-migrations:
condition: service_completed_successfully