Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
103 lines (97 loc) · 3.04 KB
/
Copy pathdocker-compose.yml
File metadata and controls
103 lines (97 loc) · 3.04 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# Local development stack. Production is provisioned via Ansible (S37);
# this file is for `make dev-db` and friends.
#
# Services:
# postgres — primary database (Postgres 16, S01)
# minio — S3-compatible object store (S04)
# mailhog — local SMTP catcher (S05)
#
# Each is volume-backed for dev persistence and bound to localhost only.
name: shithub-dev
services:
postgres:
image: postgres:16
container_name: shithub-postgres
restart: unless-stopped
environment:
POSTGRES_USER: shithub
POSTGRES_PASSWORD: shithub_dev
POSTGRES_DB: shithub
ports:
- "127.0.0.1:5432:5432"
volumes:
- shithub-pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U shithub -d shithub"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
command:
- "postgres"
- "-c"
- "shared_preload_libraries=pg_stat_statements"
- "-c"
- "log_statement=none"
- "-c"
- "max_connections=100"
# S3-compatible object storage. Non-default seed credentials —
# MinIO's defaults (minioadmin/minioadmin) are insecure even in dev.
minio:
image: minio/minio:latest
container_name: shithub-minio
restart: unless-stopped
environment:
MINIO_ROOT_USER: shithub-dev
MINIO_ROOT_PASSWORD: shithub-dev-secret-please-change
ports:
- "127.0.0.1:9000:9000" # S3 API
- "127.0.0.1:9001:9001" # web console
volumes:
- shithub-miniodata:/data
command: server /data --console-address ":9001"
healthcheck:
test: ["CMD", "curl", "-fsS", "http://127.0.0.1:9000/minio/health/live"]
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
# Local SMTP catcher (S05). The shithub auth flow writes signup /
# password-reset emails here when SHITHUB_AUTH__EMAIL_BACKEND=smtp.
# Web UI: http://127.0.0.1:8025
#
# We use Mailpit instead of the original MailHog: it's the actively
# maintained successor, ships native arm64 + amd64 images (so Apple
# Silicon hosts don't run it under x86 emulation), keeps the same
# SMTP/UI port shape, and offers the same "swallow all mail and
# show it in a web UI" semantics.
mailhog:
image: axllent/mailpit:latest
container_name: shithub-mailhog
restart: unless-stopped
environment:
MP_SMTP_BIND_ADDR: "0.0.0.0:1025"
MP_UI_BIND_ADDR: "0.0.0.0:8025"
ports:
- "127.0.0.1:1025:1025" # SMTP
- "127.0.0.1:8025:8025" # web UI
# One-shot init: creates the shithub-dev bucket via mc.
minio-init:
image: minio/mc:latest
container_name: shithub-minio-init
depends_on:
minio:
condition: service_healthy
entrypoint:
- "/bin/sh"
- "-c"
- |
set -eu
mc alias set local http://minio:9000 shithub-dev shithub-dev-secret-please-change
mc mb --ignore-existing local/shithub-dev
echo "minio-init: bucket shithub-dev ready"
volumes:
shithub-pgdata:
name: shithub-pgdata
shithub-miniodata:
name: shithub-miniodata