-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
49 lines (47 loc) · 1.7 KB
/
Copy pathdocker-compose.yml
File metadata and controls
49 lines (47 loc) · 1.7 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
services:
db:
image: postgres:18
container_name: library-db
restart: unless-stopped
environment:
POSTGRES_DB: ${LIBRARY_DB_NAME:-library}
POSTGRES_USER: ${LIBRARY_DB_USER:-postgres}
POSTGRES_PASSWORD: ${LIBRARY_DB_PASSWORD:-admin1}
PGDATA: /var/lib/postgresql/data
volumes:
# Runs once, only when the data directory is empty, and seeds the
# schema + demo data (functions, views, tables) from the dump.
- ./data/library.sql:/docker-entrypoint-initdb.d/library.sql:ro
# Named volume so data survives `docker compose restart`; remove
# with `docker compose down -v` to start from a clean database.
- library-db-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${LIBRARY_DB_USER:-postgres} -d ${LIBRARY_DB_NAME:-library}"]
interval: 5s
timeout: 5s
retries: 10
ports:
# Optional: exposes Postgres on the host too, handy for connecting
# with a local psql/DBeaver/etc. while testing. Remove if not needed.
- "5432:5432"
app:
build:
context: .
dockerfile: Dockerfile
image: library-console:latest
container_name: library-console
restart: unless-stopped
depends_on:
db:
condition: service_healthy
environment:
LIBRARY_DB_URL: jdbc:postgresql://db:5432/${LIBRARY_DB_NAME:-library}
LIBRARY_DB_USER: ${LIBRARY_DB_USER:-postgres}
LIBRARY_DB_PASSWORD: ${LIBRARY_DB_PASSWORD:-admin1}
ports:
# noVNC — open http://localhost:6080/vnc.html in a browser to use the app.
- "6080:6080"
# Raw VNC, for connecting with a native VNC client instead of a browser.
- "5900:5900"
volumes:
library-db-data: