Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
50 lines (50 loc) · 1.66 KB
/
Copy pathdocker-compose.yml
File metadata and controls
50 lines (50 loc) · 1.66 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
# Local Postgres and Redis for development only. Credentials are local
# throwaway values, not secrets: the ports are bound to 127.0.0.1.
services:
postgres:
# pgvector/pgvector is Postgres 16 plus the vector extension (#69). It is
# Debian-based (glibc) where postgres:16-alpine is musl, so a data volume
# created with the alpine image should be recreated (`docker compose down -v`),
# or its text indexes rebuilt with REINDEX, before switching.
image: pgvector/pgvector:pg16
environment:
POSTGRES_USER: oracledesk
POSTGRES_PASSWORD: oracledesk
POSTGRES_DB: oracledesk
ports: ["127.0.0.1:5433:5432"]
volumes: [pgdata:/var/lib/postgresql/data]
healthcheck:
test: ["CMD", "pg_isready", "-U", "oracledesk"]
interval: 5s
retries: 10
redis:
image: redis:7-alpine
ports: ["127.0.0.1:6379:6379"]
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
retries: 10
# Optional nightly backup loop (#146). Start with:
# docker compose --profile backup up -d backup
backup:
image: postgres:16-alpine
profiles: ["backup"]
depends_on:
postgres:
condition: service_healthy
environment:
DATABASE_URL: postgresql://oracledesk:oracledesk@postgres:5432/oracledesk
BACKUP_DIR: /backups
BACKUP_KEEP_DAILY: "7"
BACKUP_KEEP_WEEKLY: "4"
volumes:
- ./backups:/backups
- .:/repo:ro
entrypoint: >
sh -c "apk add --no-cache nodejs git >/dev/null &&
while true; do
cd /repo && DATABASE_URL=$$DATABASE_URL BACKUP_DIR=$$BACKUP_DIR ./scripts/backup.sh || true;
sleep 21600;
done"
volumes:
pgdata: