# Rackula Development Docker Compose # # For self-hosting with persistence, use: deploy/docker-compose.persist.yml # Documentation: docs/guides/SELF-HOSTING.md # # Development usage: # docker compose up -d # Frontend only (no persistence) # docker compose --profile persist up -d # With API sidecar # # Environment variables: # RACKULA_PORT: Host port for frontend (default: 8080) # RACKULA_LISTEN_PORT: Port nginx listens on inside container (default: 8080) # RACKULA_API_PORT: Port the API listens on (default: 3001) # API_HOST: API hostname for nginx proxy (default: rackula-api) # API_PORT: Derived from RACKULA_API_PORT (for nginx proxy target) services: rackula: image: ghcr.io/rackulalives/rackula:latest # For persistence, use the :persist image instead: # image: ghcr.io/rackulalives/rackula:persist container_name: rackula ports: - "${RACKULA_PORT:-8080}:${RACKULA_LISTEN_PORT:-8080}" environment: # API proxy target (API_PORT derived from RACKULA_API_PORT) - API_HOST=${API_HOST:-rackula-api} - API_PORT=${RACKULA_API_PORT:-3001} # nginx listen port inside container (allows matching host port if needed) - RACKULA_LISTEN_PORT=${RACKULA_LISTEN_PORT:-8080} restart: unless-stopped stop_grace_period: 10s deploy: resources: limits: cpus: "0.50" memory: 128M reservations: cpus: "0.10" memory: 16M security_opt: - no-new-privileges:true cap_drop: - ALL read_only: true tmpfs: - /var/cache/nginx:size=10M - /var/run:size=1M - /tmp:size=5M - /etc/nginx/conf.d:size=1M,uid=101,gid=101 logging: driver: json-file options: max-size: "10m" max-file: "3" # API sidecar for persistent storage (optional) # Enable with: docker compose --profile persist up -d rackula-api: profiles: [persist] image: ghcr.io/rackulalives/rackula-api:latest container_name: rackula-api restart: unless-stopped stop_grace_period: 10s volumes: # Note: Host directory must be writable by container user (uid 1001) # Run: mkdir -p ./data && sudo chown 1001:1001 ./data - ./data:/data environment: - DATA_DIR=/data - RACKULA_API_PORT=${RACKULA_API_PORT:-3001} deploy: resources: limits: cpus: "0.25" memory: 64M reservations: cpus: "0.05" memory: 16M security_opt: - no-new-privileges:true cap_drop: - ALL read_only: true tmpfs: - /tmp:size=5M healthcheck: test: ["CMD", "wget", "-qO-", "http://127.0.0.1:${RACKULA_API_PORT:-3001}/health"] interval: 30s timeout: 10s start_period: 5s retries: 3 logging: driver: json-file options: max-size: "5m" max-file: "2" expose: - "${RACKULA_API_PORT:-3001}"