-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
98 lines (92 loc) · 3.38 KB
/
Copy pathdocker-compose.yml
File metadata and controls
98 lines (92 loc) · 3.38 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
# Local development stack.
#
# NOTE: this stack has not been executed — Docker was unavailable on the authoring machine.
# Treat the first `docker compose up` as unverified.
#
# Redis and a Celery worker are deliberately absent. There are no asynchronous tasks yet, and
# a queue with nothing on it is infrastructure to maintain for no benefit. They arrive in
# Phase 1 alongside the download queue that needs them.
#
# The credentials here are well-known development placeholders. The application refuses to
# start in production with any of them (see src/aedifex/config.py).
#
# Images are pinned by digest so an upstream retag cannot silently change the stack under us.
# `minio/minio:latest` in particular was previously unpinned, which meant two developers could
# be running different builds while both believing they ran the same one. The tag before the
# digest is decorative: Docker resolves the digest. Dependabot raises PRs for new digests.
name: aedifex
services:
postgres:
image: postgres:17-alpine@sha256:18cfe3ef5e6815560c98237d6216d1e5119702fb0f3894c8785dd58b8bbe5d73
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: aedifex
# Speeds up the initial cluster creation; safe for a disposable dev database.
POSTGRES_INITDB_ARGS: "--auth-host=scram-sha-256"
ports:
- "5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d aedifex"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
minio:
image: minio/minio:latest@sha256:14cea493d9a34af32f524e538b8346cf79f3321eff8e708c1e2960462bd8936e
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
ports:
- "9000:9000" # S3 API
- "9001:9001" # web console
volumes:
- minio_data:/data
healthcheck:
test: ["CMD", "mc", "ready", "local"]
interval: 5s
timeout: 5s
retries: 10
start_period: 10s
# Creates the development bucket, then exits. `docker compose up` will show this container
# as completed, which is expected.
minio_init:
image: minio/mc:latest@sha256:a7fe349ef4bd8521fb8497f55c6042871b2ae640607cf99d9bede5e9bdf11727
depends_on:
minio:
condition: service_healthy
entrypoint: >
/bin/sh -c "
mc alias set local http://minio:9000 minioadmin minioadmin &&
mc mb --ignore-existing local/aedifex-dev &&
mc version enable local/aedifex-dev &&
echo 'bucket ready'
"
api:
build:
context: .
target: runtime
depends_on:
postgres:
condition: service_healthy
minio:
condition: service_healthy
environment:
AEDIFEX_ENVIRONMENT: development
AEDIFEX_DATABASE_URL: postgresql+psycopg://postgres:postgres@postgres:5432/aedifex
AEDIFEX_STORAGE_ENDPOINT_URL: http://minio:9000
AEDIFEX_STORAGE_BUCKET: aedifex-dev
AEDIFEX_STORAGE_ACCESS_KEY_ID: minioadmin
AEDIFEX_STORAGE_SECRET_ACCESS_KEY: minioadmin
AEDIFEX_LOG_FORMAT: console
AEDIFEX_LOG_LEVEL: DEBUG
ports:
- "8000:8000"
# Migrations are run explicitly (`make migrate`) rather than on container start. An
# automatic migration on boot means N replicas racing to alter the schema.
volumes:
postgres_data:
minio_data: