-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.postgres.yml
More file actions
39 lines (36 loc) · 1.24 KB
/
Copy pathdocker-compose.postgres.yml
File metadata and controls
39 lines (36 loc) · 1.24 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
# Optional: run WebUI Manager against PostgreSQL instead of the default MySQL.
#
# docker compose -f docker-compose.yml -f docker-compose.postgres.yml up -d
#
# The default compose file (and the `DB_TYPE` it omits, i.e. MySQL) is left
# untouched; this override swaps in the backend and adds a managed
# postgres:16 service with a persistent volume.
services:
app:
environment:
DB_TYPE: postgres
DB_HOST: db
# Literal on purpose: a .env that still carries MySQL's DB_PORT=3306
# would otherwise be interpolated in. Change here if your Postgres runs
# on a non-standard port.
DB_PORT: "5432"
DB_USER: ${DB_USER:-webui}
DB_PASSWORD: ${DB_PASSWORD}
DB_NAME: ${DB_NAME:-webui_manager}
# DB_SSLMODE: ${DB_SSLMODE:-disable} # uncomment for SSL-enabled servers
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: ${DB_NAME:-webui_manager}
POSTGRES_USER: ${DB_USER:-webui}
POSTGRES_PASSWORD: ${DB_PASSWORD}
volumes:
- db_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-webui} -d ${DB_NAME:-webui_manager}"]
interval: 5s
timeout: 3s
retries: 10
volumes:
db_data: