compose.yaml RawHistoryFolder
1# Development server with hot reload: `docker compose up`, then http://localhost:7341.
2# The module is built on its own (no go.work), like CI. The modules bnema.dev/ermite-* are public
3# and resolve through the bnema.dev vanity path.
4services:
5 ermite:
6 build:
7 dockerfile_inline: |
8 FROM golang:1.27-alpine
9 RUN apk add --no-cache git git-daemon
10 working_dir: /src
11 command: ["go", "tool", "air", "-c", ".air.toml"]
12 ports:
13 - "127.0.0.1:7341:7341"
14 environment:
15 CGO_ENABLED: "0"
16 GOWORK: "off"
17 GOTOOLCHAIN: local
18 # The mounted .git of a worktree points outside the container.
19 GOFLAGS: -buildvcs=false
20 ERMITE_DATA_DIR: /data
21 ERMITE_ADDR: ":7341"
22 ERMITE_PUBLIC_URL: http://localhost:7341
23 # Development placeholder, not a secret: the port is bound to the loopback.
24 ERMITE_ADMIN_TOKEN: dev-only-admin-token-do-not-use-0123456789
25 ERMITE_LOG_FORMAT: console
26 ERMITE_LOG_LEVEL: debug
27 # Empty bucket keeps the disk backend, even with the s3 profile active.
28 ERMITE_S3_BUCKET: ${ERMITE_S3_BUCKET:-}
29 ERMITE_S3_ENDPOINT: ${ERMITE_S3_ENDPOINT:-}
30 ERMITE_S3_REGION: ${ERMITE_S3_REGION:-}
31 ERMITE_S3_ACCESS_KEY_ID: ${ERMITE_S3_ACCESS_KEY_ID:-}
32 ERMITE_S3_SECRET_ACCESS_KEY: ${ERMITE_S3_SECRET_ACCESS_KEY:-}
33 ERMITE_S3_FORCE_PATH_STYLE: ${ERMITE_S3_FORCE_PATH_STYLE:-0}
34 ERMITE_S3_PREFIX: ${ERMITE_S3_PREFIX:-}
35 volumes:
36 - .:/src
37 - go-mod:/go/pkg/mod
38 - go-build:/root/.cache/go-build
39 - data:/data
40
41 minio:
42 image: minio/minio:RELEASE.2025-09-07T16-13-09Z
43 profiles: [s3]
44 command: server /data --console-address :9001
45 environment:
46 MINIO_ROOT_USER: minioadmin
47 MINIO_ROOT_PASSWORD: minioadmin
48 ports:
49 - "127.0.0.1:9000:9000"
50 - "127.0.0.1:9001:9001"
51 volumes:
52 - minio-data:/data
53 healthcheck:
54 test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
55 interval: 2s
56 timeout: 2s
57 retries: 30
58
59 # Development provisioning only. The ermite process never creates buckets.
60 minio-init:
61 image: minio/mc:RELEASE.2025-08-13T08-35-41Z
62 profiles: [s3]
63 depends_on:
64 minio:
65 condition: service_healthy
66 entrypoint: ["/bin/sh", "-c"]
67 command:
68 - "mc alias set dev http://minio:9000 minioadmin minioadmin && mc mb --ignore-existing dev/ermite && mc mb --ignore-existing dev/ermite-test"
69 restart: "no"
70
71volumes:
72 minio-data:
73 go-mod:
74 go-build:
75 data: