# ============================================ # ServerKit Docker Compose # ============================================ # Runs both backend and frontend in Docker. # Note: System management features (PHP install, # firewall, etc.) won't work in Docker. # # Usage: # docker compose up --build -d # # Access: # Frontend: http://localhost:3847 # Backend: http://localhost:5849 # ============================================ services: backend: build: context: ./backend dockerfile: Dockerfile container_name: serverkit-backend environment: - FLASK_ENV=development - SECRET_KEY=dev-secret-key-not-for-production - JWT_SECRET_KEY=dev-jwt-key-not-for-production - DATABASE_URL=sqlite:////app/instance/serverkit.db - CORS_ORIGINS=http://localhost,http://localhost:3847,http://localhost:41921 - SERVERKIT_BACKEND_PORT=5000 ports: - "5849:5000" volumes: - serverkit-data:/app/instance - serverkit-config:/etc/serverkit networks: - serverkit-network restart: unless-stopped healthcheck: test: ["CMD-SHELL", "curl -f http://localhost:$${SERVERKIT_BACKEND_PORT:-5000}/api/v1/system/health"] interval: 10s timeout: 5s retries: 3 logging: driver: "json-file" options: max-size: "10m" max-file: "3" frontend: build: context: ./frontend dockerfile: Dockerfile container_name: serverkit-frontend ports: - "3847:80" depends_on: backend: condition: service_healthy volumes: - ./frontend/dist:/usr/share/nginx/html:ro networks: - serverkit-network restart: unless-stopped healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/"] interval: 30s timeout: 10s retries: 3 logging: driver: "json-file" options: max-size: "10m" max-file: "3" networks: serverkit-network: driver: bridge name: serverkit-network volumes: serverkit-data: name: serverkit-data serverkit-config: name: serverkit-config