40 lines
1.4 KiB
YAML
40 lines
1.4 KiB
YAML
services:
|
|
server:
|
|
build: ./server
|
|
environment:
|
|
# Auth is account-based (users live in the database): the first visit
|
|
# shows a one-time account-creation screen, and more users are added in
|
|
# Settings. The old MYKINDLEBOX_PASSWORD/AUTH_PASSWORD env var is no
|
|
# longer used.
|
|
DATA_DIR: /app/data
|
|
volumes:
|
|
- server-data:/app/data
|
|
restart: unless-stopped
|
|
# busybox wget ships in node:20-alpine, so no extra package is needed.
|
|
healthcheck:
|
|
test: ["CMD", "wget", "-qO-", "http://localhost:3001/health"]
|
|
interval: 30s
|
|
timeout: 3s
|
|
start_period: 15s
|
|
retries: 3
|
|
# No published port: the server is only reached through the client's nginx
|
|
# reverse proxy on the internal compose network. Add a `ports` mapping here
|
|
# if you want to hit the API directly for debugging.
|
|
|
|
client:
|
|
build: ./client
|
|
ports:
|
|
# Host port is configurable: set MYKINDLEBOX_PORT (e.g. in the same .env
|
|
# as MYKINDLEBOX_PASSWORD) to serve on a different port. Defaults to 8080.
|
|
- "${MYKINDLEBOX_PORT:-8080}:80"
|
|
# Wait for the API to answer /health before starting nginx, so the first
|
|
# page load after `docker compose up` can't hit a 502 from a still-booting
|
|
# server.
|
|
depends_on:
|
|
server:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
server-data:
|