Skip to content

Commit da0d3ca

Browse files
committed
Updated deployment configuration
1 parent 9d46c59 commit da0d3ca

5 files changed

Lines changed: 25 additions & 7 deletions

File tree

deploy/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
.env
2+
postgres/postgresql.conf
3+
Caddyfile

deploy/README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,16 @@ This is a minimal, single-host setup for running Hackorum on a VPS (e.g., Hetzne
2020
# edit deploy/.env (SECRET_KEY_BASE, IMAP creds, etc.)
2121
```
2222

23-
2) Update Caddyfile domain:
23+
2) Copy and tune Postgres config:
24+
```bash
25+
cp deploy/postgres/postgresql.conf.example deploy/postgres/postgresql.conf
26+
# edit deploy/postgres/postgresql.conf to match host resources
27+
```
28+
29+
3) Update Caddyfile domain:
2430
- Edit `deploy/Caddyfile` and replace `hackorum.example.com` and contact email.
2531

26-
3) Build and start:
32+
4) Build and start:
2733
```bash
2834
cd deploy
2935
docker compose up -d --build
@@ -35,7 +41,7 @@ This is a minimal, single-host setup for running Hackorum on a VPS (e.g., Hetzne
3541
- `caddy`: TLS + reverse proxy on :80/:443
3642
- `autoheal`: restarts containers whose healthchecks fail
3743

38-
4) Verify:
44+
5) Verify:
3945
- Browse to your domain; or `curl -f http://localhost:3000/up` from the host (`docker compose exec web ...` inside the network).
4046

4147
## Environment variables (deploy/.env)

deploy/docker-compose.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,11 @@ services:
1212
- pgdata:/var/lib/postgresql
1313
- pgwal:/var/lib/postgresql/wal-archive
1414
- pgbackups:/backups
15+
- ./postgres/postgresql.conf:/etc/postgresql/postgresql.conf:ro # copy from postgresql.conf.example
1516
command:
1617
[
1718
"postgres",
18-
"-c", "wal_level=replica",
19-
"-c", "archive_mode=on",
20-
"-c", "archive_timeout=60",
21-
"-c", "archive_command=test ! -f /var/lib/postgresql/wal-archive/%f \\&\\& cp %p /var/lib/postgresql/wal-archive/%f"
19+
"-c", "config_file=/etc/postgresql/postgresql.conf"
2220
]
2321
healthcheck:
2422
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres} -d ${POSTGRES_DB:-hackorum}"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
shared_buffers = 4GB
2+
effective_cache_size = 12GB
3+
work_mem = 32MB
4+
maintenance_work_mem = 1GB
5+
6+
wal_level = replica
7+
wal_compression = on
8+
archive_mode = on
9+
archive_timeout = 60s
10+
archive_command = 'test ! -f /var/lib/postgresql/wal-archive/%f && cp %p /var/lib/postgresql/wal-archive/%f' # keep && unescaped so the shell runs both commands
11+
max_wal_size = 8GB
12+
min_wal_size = 2GB

0 commit comments

Comments
 (0)