@@ -55,19 +55,18 @@ RUN pip uninstall jwt -y && \
5555 pip install PyJWT==2.9.0 --no-cache-dir
5656
5757# --- Prisma Handling for Non-Root User ---
58- # Set Prisma cache directories
58+ # Set Prisma cache directory (npm cache no longer needed with binary pre-caching)
5959ENV PRISMA_BINARY_CACHE_DIR=/nonexistent
60- ENV NPM_CONFIG_CACHE=/.npm
6160
6261# Install prisma and make entrypoints executable
6362RUN pip install --no-cache-dir prisma && \
6463 chmod +x docker/entrypoint.sh && \
6564 chmod +x docker/prod_entrypoint.sh
6665
6766# Create directories and set permissions for non-root user
68- RUN mkdir -p /nonexistent /.npm && \
67+ RUN mkdir -p /nonexistent && \
6968 chown -R nobody:nogroup /app && \
70- chown -R nobody:nogroup /nonexistent /.npm && \
69+ chown -R nobody:nogroup /nonexistent && \
7170 PRISMA_PATH=$(python -c "import os, prisma; print(os.path.dirname(prisma.__file__))") && \
7271 chown -R nobody:nogroup $PRISMA_PATH
7372
@@ -91,18 +90,18 @@ USER nobody
9190# Set HOME for prisma generate to have a writable directory
9291ENV HOME=/app
9392
94- # Elegant solution: Force Prisma to download and cache all binaries at build time
93+ # Force Prisma to download and cache all binaries at build time -> for offline deployment
9594# This uses official Prisma environment variables for offline deployment
9695ENV PRISMA_ENGINES_CHECKSUM_IGNORE_MISSING=1
9796ENV PRISMA_CLI_BINARY_TARGETS=linux-musl-openssl-3.0.x,linux-musl-arm64-openssl-3.0.x
9897
99- # Generate Prisma client and cache all engine binaries
98+ # this will generate the Prisma client and cache all engine binaries
10099RUN prisma generate
101100
102- # Verify all engines are properly cached by running essential commands
103101# These commands force download of all CLI binaries without dummy database URLs
104102RUN prisma version
105103RUN prisma format --schema=/dev/null || echo "Schema format test completed"
104+
106105# --- End of Prisma Handling ---
107106
108107EXPOSE 4000/tcp
0 commit comments