Files
screenshot-tools/docker-compose.traefik.yml
Frank John Begornia 4b7d43efc2
All checks were successful
Deploy Production (ss-tools.crewsportswear.app) / deploy (push) Successful in 2m47s
Update server port to 80 and enhance health check configuration in Docker setup
2025-12-31 02:58:44 +08:00

54 lines
1.7 KiB
YAML

services:
screenshot-service:
image: screenshot-tools:latest
container_name: screenshot_service
restart: unless-stopped
healthcheck:
test: ["CMD", "wget", "--quiet", "--tries=1", "--spider", "http://localhost:80/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
environment:
- PORT=80
- HOST=0.0.0.0
- USE_SSL=false
- OUTPUT_DIR=/var/www/html/images/
- BASE_URL=https://ss-tools.crewsportswear.app/
- VIEWPORT_WIDTH=1366
- VIEWPORT_HEIGHT=1100
- WAIT_TIME=10000
volumes:
- screenshot_images:/var/www/html/images
networks:
- traefik-public
labels:
# Enable Traefik
- "traefik.enable=true"
# HTTP Router
- "traefik.http.routers.screenshot-service.rule=Host(`ss-tools.crewsportswear.app`)"
- "traefik.http.routers.screenshot-service.entrypoints=websecure"
- "traefik.http.routers.screenshot-service.tls=true"
- "traefik.http.routers.screenshot-service.tls.certresolver=le"
# Service
- "traefik.http.services.screenshot-service.loadbalancer.server.port=80"
# HTTP to HTTPS redirect
- "traefik.http.routers.screenshot-service-http.rule=Host(`ss-tools.crewsportswear.app`)"
- "traefik.http.routers.screenshot-service-http.entrypoints=web"
- "traefik.http.routers.screenshot-service-http.middlewares=https-redirect"
# HTTPS Redirect Middleware
- "traefik.http.middlewares.https-redirect.redirectscheme.scheme=https"
- "traefik.http.middlewares.https-redirect.redirectscheme.permanent=true"
volumes:
screenshot_images:
driver: local
networks:
traefik-public:
external: true