services: backend: build: context: . dockerfile: Dockerfile.dev target: builder # Build only the builder stage cache_from: - type=local,src=/tmp/.buildx-cache args: BUILDKIT_INLINE_CACHE: 1 container_name: myclub-backend env_file: - .env environment: - DATABASE_URL=postgres://postgres:postgres@db:5432/fotbal_club?sslmode=disable - JWT_SECRET=your_jwt_secret_key_here - UPLOAD_DIR=./uploads - PORT=8080 - RUN_MIGRATIONS=true - SEED_DATABASE=false depends_on: db: condition: service_healthy volumes: - ./uploads:/app/uploads - ./cache:/app/cache working_dir: /app command: ["./main"] ports: - "8080:8080" restart: unless-stopped networks: - fotbal-network healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:8080/api/v1/health"] interval: 30s timeout: 10s retries: 3 start_period: 30s deploy: resources: limits: cpus: '2.0' memory: 1G reservations: cpus: '0.5' memory: 256M frontend: build: context: ./frontend dockerfile: Dockerfile cache_from: - type=local,src=/tmp/.buildx-cache-frontend args: BUILDKIT_INLINE_CACHE: 1 container_name: myclub-frontend ports: - "3000:80" depends_on: - backend environment: - REACT_APP_API_URL=http://localhost:8080/api/v1 restart: unless-stopped networks: - fotbal-network deploy: resources: limits: cpus: '1.0' memory: 512M reservations: cpus: '0.25' memory: 128M healthcheck: test: ["CMD", "wget", "--spider", "-q", "http://localhost:80/"] interval: 30s timeout: 5s retries: 3 start_period: 10s db: image: postgres:15-alpine container_name: myclub-db environment: - POSTGRES_USER=postgres - POSTGRES_PASSWORD=postgres - POSTGRES_DB=fotbal_club - POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=C --lc-ctype=C ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data/ tmpfs: - /tmp - /var/run/postgresql restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 networks: - fotbal-network deploy: resources: limits: cpus: '2.0' memory: 2G reservations: cpus: '0.5' memory: 512M shm_size: 256M command: - "postgres" - "-c" - "shared_buffers=256MB" - "-c" - "max_connections=200" - "-c" - "effective_cache_size=1GB" - "-c" - "maintenance_work_mem=128MB" - "-c" - "checkpoint_completion_target=0.9" - "-c" - "wal_buffers=16MB" - "-c" - "default_statistics_target=100" - "-c" - "random_page_cost=1.1" - "-c" - "effective_io_concurrency=200" - "-c" - "work_mem=2621kB" - "-c" - "min_wal_size=1GB" - "-c" - "max_wal_size=4GB" - "-c" - "fsync=on" volumes: postgres_data: uploads: networks: fotbal-network: driver: bridge