Prepare for Docker deployment

This commit is contained in:
2025-11-23 11:32:48 -07:00
parent 7b34cb0340
commit 7e11b2d531
3 changed files with 18 additions and 25 deletions

View File

@@ -1,4 +1,3 @@
# Server (dev only)
HOST=0.0.0.0 HOST=0.0.0.0
PORT=8080 PORT=8080
MAX_CONCURRENT=3 MAX_CONCURRENT=3
@@ -7,7 +6,7 @@ ADMIN_PASSWORD=test123
TIMEZONE=America/Edmonton TIMEZONE=America/Edmonton
# Public uploader page (optional) — disabled by default # Public uploader page (optional) — disabled by default
PUBLIC_UPLOAD_PAGE_ENABLED=TRUE PUBLIC_UPLOAD_PAGE_ENABLED=false
# Local dedupe cache (SQLite) # Local dedupe cache (SQLite)
STATE_DB=./data/state.db STATE_DB=./data/state.db
@@ -16,13 +15,14 @@ STATE_DB=./data/state.db
# e.g., PUBLIC_BASE_URL=https://photos.example.com # e.g., PUBLIC_BASE_URL=https://photos.example.com
#PUBLIC_BASE_URL= #PUBLIC_BASE_URL=
# Session and security LOG_LEVEL=INFO
SESSION_SECRET=SET-A-STRONG-RANDOM-VALUE
LOG_LEVEL=DEBUG
# Chunked uploads (to work around 100MB proxy limits) # Chunked uploads (to work around 100MB proxy limits)
# Enable to send files in chunks from browser to this service; the service reassembles and forwards to Immich. # Enable to send files in chunks from browser to this service
# Recommended chunk size for Cloudflare Tunnel is <= 95MB. # Recommended chunk size for Cloudflare Tunnel is <= 95MB.
CHUNKED_UPLOADS_ENABLED=false CHUNKED_UPLOADS_ENABLED=false
CHUNK_SIZE_MB=95 CHUNK_SIZE_MB=95
# Custom session secrets
# By default, a random one is generated
#SESSION_SECRET=SET-A-STRONG-RANDOM-VALUE

View File

@@ -1,28 +1,27 @@
# syntax=docker/dockerfile:1.7 # syntax=docker/dockerfile:1.7
FROM python:3.11-slim FROM python:3.11-slim
WORKDIR /immich_drop WORKDIR /image_drop
ENV PYTHONDONTWRITEBYTECODE=1 \ ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 PYTHONUNBUFFERED=1
# Install Python deps
COPY requirements.txt /app/requirements.txt
RUN pip install --no-cache-dir -r /app/requirements.txt \
&& pip install --no-cache-dir python-multipart
# Copy app code # Copy app code
COPY . /immich_drop COPY . /image_drop
# Install Python deps
RUN pip install --no-cache-dir -r requirements.txt \
&& pip install --no-cache-dir python-multipart
# Data dir for SQLite (state.db) # Data dir for SQLite (state.db)
RUN mkdir -p /data #RUN mkdir -p /data
VOLUME ["/data"] #VOLUME ["/data"]
# Defaults (can be overridden via compose env) # Defaults (can be overridden via compose env)
ENV HOST=0.0.0.0 \ ENV HOST=0.0.0.0 \
PORT=8080 \ PORT=8080 \
STATE_DB=/data/state.db STATE_DB=/image_drop/data/state.db
EXPOSE 8080 EXPOSE 8080

View File

@@ -1,23 +1,17 @@
services: services:
immich-drop: image-drop:
build: . build: .
container_name: immich-drop container_name: image-drop
restart: unless-stopped restart: unless-stopped
ports: ports:
- "8080:8080" - "8080:8080"
env_file: env_file:
- .env - .env
volumes: volumes:
- immich_drop_data:/data - ./data:/image_drop/data
healthcheck: healthcheck:
test: ["CMD-SHELL", "python - <<'PY'\nimport urllib.request,sys\ntry:\n urllib.request.urlopen('http://localhost:8080/').read(); sys.exit(0)\nexcept Exception:\n sys.exit(1)\nPY"] test: ["CMD-SHELL", "python - <<'PY'\nimport urllib.request,sys\ntry:\n urllib.request.urlopen('http://localhost:8080/').read(); sys.exit(0)\nexcept Exception:\n sys.exit(1)\nPY"]
interval: 30s interval: 30s
timeout: 5s timeout: 5s
retries: 3 retries: 3
start_period: 10s start_period: 10s
volumes:
immich_drop_data: