fetch_ml/deployments/docker-compose.prod.smoke.yml
Jeremie Fraeys 5691b06876
fix(deployments): add env var support for data directories
Update all docker-compose files to use environment variables for data paths:

- docker-compose.local.yml: Use LOCAL_DATA_DIR with fallback to ../data/dev
- docker-compose.prod.yml: Use PROD_DATA_DIR with fallback to data/prod
- docker-compose.prod.smoke.yml: Use SMOKE_TEST_DATA_DIR with fallback

This allows smoke tests and local development to use temp directories
instead of repo-relative paths, avoiding file sharing permission issues
on macOS with Docker Desktop or Colima.
2026-02-24 11:43:11 -05:00

83 lines
2.5 KiB
YAML

services:
caddy:
image: caddy:2-alpine
container_name: ml-smoke-caddy
environment:
- FETCHML_DOMAIN=localhost
ports:
- "8080:80"
volumes:
- ${FETCHML_REPO_ROOT:-..}/deployments/Caddyfile.prod.smoke:/etc/caddy/Caddyfile:ro
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/caddy/data:/data
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/caddy/config:/config
networks:
- default
depends_on:
- api-server
redis:
image: redis:7-alpine
user: "999:999"
restart: unless-stopped
expose:
- "6379"
volumes:
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/redis:/data
command: redis-server --appendonly yes
healthcheck:
test: [ "CMD", "redis-cli", "ping" ]
interval: 10s
timeout: 5s
retries: 10
api-server:
build:
context: ${FETCHML_REPO_ROOT:-..}
dockerfile: build/docker/simple.Dockerfile
user: "0:0"
restart: unless-stopped
expose:
- "9101"
depends_on:
redis:
condition: service_healthy
volumes:
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/experiments:/data/experiments
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/active:/data/active
- ${SMOKE_TEST_DATA_DIR:-${FETCHML_REPO_ROOT:-..}/data/prod-smoke}/logs:/logs
- ${FETCHML_REPO_ROOT:-..}/configs/api/dev.yaml:/app/configs/api/dev.yaml:ro
command: ["/bin/sh", "-c", "mkdir -p /data/experiments /data/active/datasets /data/active/snapshots && exec /usr/local/bin/api-server -config /app/configs/api/dev.yaml"]
environment:
- LOG_LEVEL=info
healthcheck:
test: [ "CMD", "curl", "-f", "http://localhost:9101/health" ]
interval: 10s
timeout: 5s
retries: 10
ssh-test-server:
image: linuxserver/openssh-server:latest
container_name: ml-ssh-test
environment:
- PUID=1000
- PGID=1000
- TZ=America/New_York
- PUBLIC_KEY_FILE=/tmp/test_key.pub
- USER_NAME=test
- PASSWORD_ACCESS=false
volumes:
- ${FETCHML_REPO_ROOT:-..}/deployments/test_keys:/tmp:ro
- ${FETCHML_REPO_ROOT:-..}/bin/tui-linux:/usr/local/bin/tui:ro
- ${FETCHML_REPO_ROOT:-..}/deployments/tui-test-config.toml:/config/.ml/config.toml:ro
ports:
- "2222:2222"
networks:
- default
depends_on:
- caddy
- api-server
networks:
default:
name: ml-prod-smoke-network