6e0eda8ba4
- Fix SQLCipher PRAGMA key interpolation (hex-encode key to prevent crash on single quotes) - Enforce min password length (8 chars) on admin user creation - Add length bounds on username/display_name and login inputs - Invalidate other sessions on password change - Multi-stage Docker build (exclude build tools from runtime) - Exclude docs/ from Docker image - Consolidate dotenv.config() to single entry point - Document flat family authorization model in SECURITY.md Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
44 lines
938 B
Docker
44 lines
938 B
Docker
FROM node:22-slim AS build
|
|
|
|
# SQLCipher-Abhängigkeiten
|
|
RUN apt-get update && apt-get install -y \
|
|
python3 \
|
|
make \
|
|
g++ \
|
|
libsqlcipher-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Abhängigkeiten zuerst (Docker-Layer-Caching)
|
|
COPY package*.json ./
|
|
RUN npm ci --omit=dev
|
|
|
|
# ---- Runtime stage ----
|
|
FROM node:22-slim
|
|
|
|
RUN apt-get update && apt-get install -y \
|
|
libsqlcipher0 \
|
|
gosu \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Node modules aus Build-Stage kopieren
|
|
COPY --from=build /app/node_modules ./node_modules
|
|
|
|
# Anwendungscode (docs/ wird via .dockerignore ausgeschlossen)
|
|
COPY . .
|
|
|
|
# Daten-Volume-Verzeichnis anlegen (Permissions werden zur Laufzeit gesetzt)
|
|
RUN mkdir -p /data
|
|
|
|
# Entrypoint: korrigiert /data-Permissions und startet als node-User
|
|
COPY entrypoint.sh /entrypoint.sh
|
|
RUN chmod +x /entrypoint.sh
|
|
|
|
EXPOSE 3000
|
|
|
|
ENTRYPOINT ["/entrypoint.sh"]
|
|
CMD ["node", "server/index.js"]
|