naf / Dockerfile
Rajhuggingface4253's picture
Rename dockerfile to Dockerfile
07d83d4 verified
raw
history blame contribute delete
762 Bytes
# Use Node 20 Slim (Lightweight & Secure)
FROM node:20-bookworm-slim
# Set working directory
WORKDIR /app
# Install system tools for SQLite compilation (if needed)
RUN apt-get update && apt-get install -y --no-install-recommends \
python3 \
make \
g++ \
&& rm -rf /var/lib/apt/lists/*
# Copy package files
COPY package*.json ./
# --- FIX IS HERE ---
# Changed from 'npm ci' to 'npm install' so it works without a lockfile
# Changed '--only=production' to '--omit=dev' (New Standard)
RUN npm install --omit=dev
# Copy Source Code
COPY . .
# Create data directory with correct permissions
RUN mkdir -p /app/data && chown -R node:node /app
# Switch to secure user
USER node
# Expose Port
EXPOSE 7860
# Start Server
CMD ["node", "server.js"]