forked from JsCodeDevlopment/syncable
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
86 lines (82 loc) · 2.03 KB
/
docker-compose.yml
File metadata and controls
86 lines (82 loc) · 2.03 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
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
75
76
77
78
79
80
81
82
83
84
85
86
---
services:
db-init:
container_name: db-init
image: postgres:15.8-bookworm
environment:
PGPASSWORD: default
volumes:
- "./init-db.sql:/init-db.sql:ro"
command: >
bash -c "
echo 'Waiting for database to be ready...' &&
until pg_isready -h db -U postgres; do
echo 'Database not ready, waiting...';
sleep 2;
done &&
echo 'Database ready, running init script...' &&
psql -h db -U postgres -d postgres -f /init-db.sql &&
echo 'Database initialization complete!'
"
depends_on:
db:
condition: service_healthy
restart: on-failure
app:
container_name: app
build:
context: .
dockerfile: Dockerfile.dev
environment:
DATABASE_URL: postgresql://postgres:default@db:5432/postgres
NODE_ENV: development
NEXT_PUBLIC_APP_VERSION: local-snapshot
command: >
bash -c "
yarn install &&
yarn dev
"
ports:
- "3000:3000"
user: root
volumes:
- ".:/app"
- /app/node_modules
working_dir: /app
depends_on:
db:
condition: service_healthy
db-init:
condition: service_completed_successfully
healthcheck:
test: timeout 10s bash -c 'true > /dev/tcp/127.0.0.1/3000'
interval: 1m30s
timeout: 15s
retries: 3
start_period: 10s
schemaspy:
container_name: schemaspy
profiles: ["schemaspy"]
image: schemaspy/schemaspy:7.0.2
user: ${UID:-1000}:${GID:-1000}
volumes:
- "./schemaspy/output:/output"
- "./schemaspy/postgres.properties:/schemaspy.properties"
depends_on:
db:
condition: service_healthy
db:
container_name: db
image: postgres:15.8-bookworm
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: default
ports:
- "5432:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 1m30s
timeout: 15s
retries: 3
start_period: 10s