version: '3.8' services: # Nginx reverse proxy and static file server nginx: image: nginx:alpine container_name: etsy-nginx ports: - "3000:80" volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro - client_dist:/usr/share/nginx/html:ro depends_on: - etsy-tracker restart: unless-stopped networks: - etsy-network healthcheck: test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost/health"] interval: 30s timeout: 10s retries: 3 start_period: 10s # Etsy Finance Tracker API Server (from GitHub Container Registry) etsy-tracker: image: ghcr.io/dlawler489/etsy-finance-tracker:main container_name: etsy-finance-tracker expose: - "8080" environment: - NODE_ENV=production - PORT=8080 - CLIENT_URL=http://nginx volumes: # Mount data directory for persistent storage - ./data:/app/data # Optional: Mount uploads directory if needed - etsy_uploads:/app/uploads # Share client build with nginx - client_dist:/usr/share/nginx/html restart: unless-stopped networks: - etsy-network healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8080/health"] interval: 30s timeout: 10s retries: 3 start_period: 40s command: > sh -c " if [ ! -f /usr/share/nginx/html/index.html ]; then echo 'Extracting client files...'; cp -r /app/client/dist/* /usr/share/nginx/html/ 2>/dev/null || true; fi; exec node server/index.js " # Optional: MongoDB for future database needs # mongodb: # image: mongo:6.0 # container_name: etsy-mongo # ports: # - "27017:27017" # environment: # MONGO_INITDB_ROOT_USERNAME: admin # MONGO_INITDB_ROOT_PASSWORD: changeme # volumes: # - etsy_mongodb_data:/data/db # networks: # - etsy-network # restart: unless-stopped volumes: etsy_uploads: client_dist: # etsy_mongodb_data: networks: etsy-network: driver: bridge