feat: update Docker configuration for improved GPU support and streamline service definitions

This commit is contained in:
ashim-hq
2026-04-20 11:11:40 +08:00
parent 6edb92c242
commit d3c3ce0e32
3 changed files with 43 additions and 48 deletions
+4 -1
View File
@@ -148,7 +148,7 @@ RUN for i in 1 2 3; do apt-get -o Acquire::Retries=3 update && break || sleep $(
potrace \
curl \
gosu \
libheif-examples libheif-plugin-x265 \
libheif-examples \
libimage-exiftool-perl \
python3 python3-pip python3-venv python3-dev \
tesseract-ocr tesseract-ocr-eng tesseract-ocr-deu tesseract-ocr-fra tesseract-ocr-spa \
@@ -157,6 +157,9 @@ RUN for i in 1 2 3; do apt-get -o Acquire::Retries=3 update && break || sleep $(
libgl1 libglib2.0-0 \
libegl1 libwayland-egl1 libwayland-client0 libwayland-cursor0 \
libxkbcommon-x11-0 libxkbcommon0 libxcursor1 \
&& if apt-cache show libheif-plugin-x265 >/dev/null 2>&1; then \
apt-get install -y --no-install-recommends libheif-plugin-x265; \
fi \
&& rm -rf /var/lib/apt/lists/*
# Caire binary (content-aware seam carving)
+9
View File
@@ -0,0 +1,9 @@
services:
ashim:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
+30 -47
View File
@@ -1,57 +1,40 @@
name: ashim
# Usage:
# CPU: docker compose --profile cpu up -d
# GPU: docker compose --profile gpu up -d
x-common: &common
build:
context: ..
dockerfile: docker/Dockerfile
image: ashim:latest
ports:
- "1349:1349"
volumes:
- ashim-data:/data
- ashim-workspace:/tmp/workspace
environment:
- AUTH_ENABLED=true
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
- SKIP_MUST_CHANGE_PASSWORD=${SKIP_MUST_CHANGE_PASSWORD:-false}
- RATE_LIMIT_PER_MIN=${RATE_LIMIT_PER_MIN:-100}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:1349/api/v1/health"]
interval: 30s
timeout: 5s
start_period: 60s
retries: 3
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
# CPU: docker compose up -d
# GPU: docker compose -f docker-compose.yml -f docker-compose.gpu.yml up -d
# (requires NVIDIA GPU + nvidia-container-toolkit; not supported on macOS)
services:
ashim:
<<: *common
build:
context: ..
dockerfile: docker/Dockerfile
image: ashim:latest
container_name: ashim
profiles:
- cpu
ashim-gpu:
<<: *common
container_name: ashim-gpu
profiles:
- gpu
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
ports:
- "1349:1349"
volumes:
- ashim-data:/data
- ashim-workspace:/tmp/workspace
environment:
- AUTH_ENABLED=true
- DEFAULT_USERNAME=admin
- DEFAULT_PASSWORD=admin
- SKIP_MUST_CHANGE_PASSWORD=${SKIP_MUST_CHANGE_PASSWORD:-false}
- RATE_LIMIT_PER_MIN=${RATE_LIMIT_PER_MIN:-100}
restart: unless-stopped
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:1349/api/v1/health"]
interval: 30s
timeout: 5s
start_period: 60s
retries: 3
logging:
driver: json-file
options:
max-size: "10m"
max-file: "3"
volumes:
ashim-data: