reduce docker image size

This commit is contained in:
orangecoding
2025-12-10 13:23:17 +01:00
parent cef9b5c8fc
commit 2a815c92e6
4 changed files with 99 additions and 27 deletions

View File

@@ -1,22 +1,24 @@
services:
fredy:
container_name: fredy
# build from empty build folder to reduce size of image
build:
context: .
dockerfile: Dockerfile
image: ghcr.io/orangecoding/fredy
# map existing config and database
volumes:
- ./conf:/conf
- ./db:/db
ports:
- "9998:9998"
restart: unless-stopped
# Resource limits to prevent runaway memory usage from Chromium
deploy:
resources:
limits:
memory: 1G
healthcheck:
# The container will immediately stop when health check fails after retries
test: ["CMD-SHELL", "curl --fail --silent --show-error --max-time 5 http://localhost:9998/ || exit 1"]
test: ["CMD", "curl", "--fail", "--silent", "--show-error", "--max-time", "5", "http://localhost:9998/"]
interval: 120s
timeout: 10s
retries: 1
start_period: 10s
retries: 3
start_period: 30s