# Build and run
docker-compose up -d
# View logs
docker-compose logs -f
# Stop
docker-compose downversion: '3.8'
services:
conductor:
build: .
container_name: trainforge-conductor
ports:
- "8000:8000"
volumes:
- ./config:/app/config:ro
environment:
- CONDUCTOR_LOG_LEVEL=INFO
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
interval: 30s
timeout: 10s
retries: 3# Build
docker build -t trainforge-conductor .
# Run
docker run -d \
--name trainforge-conductor \
-p 8000:8000 \
-v $(pwd)/config:/app/config:ro \
trainforge-conductor
# Check logs
docker logs -f trainforge-conductor
# Stop
docker stop trainforge-conductor
docker rm trainforge-conductorPass configuration via environment:
docker run -d \
-p 8000:8000 \
-e CONDUCTOR_PORT=8000 \
-e CONDUCTOR_LOG_LEVEL=DEBUG \
-v $(pwd)/config:/app/config:ro \
trainforge-conductorservices:
conductor:
build: .
deploy:
resources:
limits:
cpus: '2'
memory: 1G
reservations:
cpus: '0.5'
memory: 256Mservices:
conductor:
build: .
deploy:
replicas: 3- Push to GitHub
- Connect repo to Railway
- Add config as volume or environment
fly launch
fly secrets set CONDUCTOR_CONFIG_PATH=/app/config/config.yaml
fly deploy- Connect GitHub repo
- Set build command:
docker build -t app . - Mount config volume
The container includes a health check:
curl http://localhost:8000/health
# {"status": "healthy", "service": "trainforge-conductor"}Docker will automatically restart unhealthy containers when using restart: unless-stopped.