forked from
tranquil.farm/tranquil-pds
Our Personal Data Server from scratch!
1services:
2 tranquil-pds:
3 build:
4 context: .
5 dockerfile: Dockerfile
6 image: tranquil-pds:latest
7 restart: unless-stopped
8 environment:
9 SERVER_HOST: "0.0.0.0"
10 volumes:
11 - ./config.toml:/etc/tranquil-pds/config.toml:ro
12 - blob_data:/var/lib/tranquil/blobs
13 depends_on:
14 db:
15 condition: service_healthy
16 healthcheck:
17 test: ["CMD", "wget", "-q", "--spider", "http://localhost:3000/xrpc/_health"]
18 interval: 30s
19 timeout: 10s
20 retries: 3
21 start_period: 10s
22 deploy:
23 resources:
24 limits:
25 memory: 1G
26 reservations:
27 memory: 256M
28
29 db:
30 image: postgres:18-alpine
31 restart: unless-stopped
32 environment:
33 POSTGRES_USER: tranquil_pds
34 POSTGRES_PASSWORD: "CHANGE-ME"
35 POSTGRES_DB: pds
36 volumes:
37 # In memory of @mrrp.lol when Lewis had "/data" here and the account got nuked on restart including rotation key :(
38 - postgres_data:/var/lib/postgresql
39 healthcheck:
40 test: ["CMD-SHELL", "pg_isready -U tranquil_pds -d pds"]
41 interval: 10s
42 timeout: 5s
43 retries: 5
44 start_period: 10s
45 deploy:
46 resources:
47 limits:
48 memory: 512M
49 reservations:
50 memory: 128M
51
52 nginx:
53 image: nginx:1.29-alpine
54 restart: unless-stopped
55 ports:
56 - "80:80"
57 - "443:443"
58 volumes:
59 - ./nginx.conf:/etc/nginx/nginx.conf:ro
60 - ./certs:/etc/nginx/certs:ro
61 - acme_challenge:/var/www/acme:ro
62 depends_on:
63 - tranquil-pds
64 healthcheck:
65 test: ["CMD", "nginx", "-t"]
66 interval: 30s
67 timeout: 10s
68 retries: 3
69
70 certbot:
71 image: certbot/certbot:v5.2.2
72 volumes:
73 - ./certs:/etc/letsencrypt
74 - acme_challenge:/var/www/acme
75 entrypoint: "/bin/sh -c 'trap exit TERM; while :; do certbot renew --webroot -w /var/www/acme; sleep 12h & wait $${!}; done'"
76
77 prometheus:
78 image: prom/prometheus:v3.8.0
79 restart: unless-stopped
80 ports:
81 - "127.0.0.1:9090:9090"
82 volumes:
83 - ./observability/prometheus.yaml:/etc/prometheus/prometheus.yaml:ro
84 - prometheus_data:/prometheus
85 command:
86 - '--config.file=/etc/prometheus/prometheus.yaml'
87 - '--storage.tsdb.path=/prometheus'
88 - '--storage.tsdb.retention.time=30d'
89 deploy:
90 resources:
91 limits:
92 memory: 256M
93
94volumes:
95 postgres_data:
96 blob_data:
97 prometheus_data:
98 acme_challenge: