41 lines
1.4 KiB
YAML
41 lines
1.4 KiB
YAML
# Local development / smoke-test compose file.
|
|
# Unlike docker-compose.example.yml (which pulls a pre-built image from a registry),
|
|
# this file BUILDS the image from the local Dockerfile so you can iterate without
|
|
# pushing anywhere.
|
|
#
|
|
# Usage:
|
|
# 1. Copy .env.example to .env and fill in UPDATER_API_KEY (e.g. `openssl rand -hex 32`)
|
|
# 2. Optionally adjust STACKS_ROOT below to point at a directory you actually have
|
|
# compose stacks in (default points at this repo dir, which is fine for smoke tests)
|
|
# 3. docker compose -f docker-compose.local.yml up --build
|
|
# 4. curl -s http://localhost:8080/healthz | jq
|
|
# 5. curl -sH "Authorization: Bearer $UPDATER_API_KEY" -d '{"image":"test"}' \
|
|
# http://localhost:8080/update | jq
|
|
|
|
services:
|
|
package-updater:
|
|
build:
|
|
context: .
|
|
args:
|
|
VERSION: dev-local
|
|
COMMIT: ${COMMIT:-unknown}
|
|
BUILD_TIME: ${BUILD_TIME:-unknown}
|
|
container_name: package-updater-local
|
|
restart: unless-stopped
|
|
environment:
|
|
- UPDATER_API_KEY=${UPDATER_API_KEY}
|
|
- STACKS_ROOT=${STACKS_ROOT:-/tmp}
|
|
- LOG_LEVEL=debug
|
|
- PORT=8080
|
|
- UPDATE_TIMEOUT=5m
|
|
ports:
|
|
- "8080:8080"
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- ${STACKS_ROOT:-/tmp}:${STACKS_ROOT:-/tmp}:ro
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-q", "-O-", "http://localhost:8080/healthz"]
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 3
|