mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(docker): close remaining airgap gaps for fully offline operation (#70)
Three fixes to ensure zero network access after docker pull: 1. rembg model allowlist: validate model parameter against the 7 pre-downloaded models, preventing rembg from attempting to download unknown models via a raw API call. 2. GFPGAN/CodeFormer auxiliary models: pre-download facexlib's detection_Resnet50_Final.pth and parsing_parsenet.pth at build time. These were previously downloaded on first use via basicsr. Symlinks in /app/gfpgan/weights/ ensure codeformer-pip also finds them. 3. OpenCV colorize models: pre-download the prototxt, caffemodel, and pts_in_hull.npy so the lightweight OpenCV colorizer fallback works in addition to the primary DDColor method. Co-authored-by: stirling-image <stirling-image@users.noreply.github.com>
This commit is contained in:
co-authored by
stirling-image
parent
e3bfa6585a
commit
8d8ab4bc45
@@ -187,6 +187,11 @@ COPY --from=builder /app/apps/web/dist ./apps/web/dist
|
||||
# Create required directories
|
||||
RUN mkdir -p /data /data/files /tmp/workspace
|
||||
|
||||
# Symlink facexlib models for codeformer-pip (expects gfpgan/weights/ relative to CWD)
|
||||
RUN mkdir -p /app/gfpgan/weights/CodeFormer && \
|
||||
ln -sf /opt/models/gfpgan/facelib /app/gfpgan/weights/facelib && \
|
||||
ln -sf /opt/models/codeformer/codeformer.pth /app/gfpgan/weights/CodeFormer/codeformer.pth
|
||||
|
||||
# Environment defaults
|
||||
ENV PORT=1349 \
|
||||
NODE_ENV=production \
|
||||
|
||||
Reference in New Issue
Block a user