initial commit

This commit is contained in:
m0rph3us1987
2026-01-07 13:27:11 +01:00
commit 1c756af238
19 changed files with 6603 additions and 0 deletions

44
Dockerfile Normal file
View File

@@ -0,0 +1,44 @@
# --- Stage 1: Build Frontend ---
FROM node:20-alpine AS builder
WORKDIR /app
# Copy dependency files
COPY package*.json ./
RUN npm ci
# Copy source code (files in .dockerignore are excluded)
COPY . .
# Build the frontend
RUN npm run build
# --- Stage 2: Production Server ---
FROM node:20-alpine
WORKDIR /app
# Install dependencies for sqlite3
RUN apk add --no-cache python3 make g++
# Copy package files and install production dependencies
COPY package*.json ./
RUN npm ci --omit=dev
# Copy backend server and config
COPY server.js .
COPY metadata.json .
# Copy built frontend from builder stage
COPY --from=builder /app/dist ./dist
# 1. Create the uploads folder explicitly
# 2. Set ownership of the app directory to the 'node' user
RUN mkdir -p uploads && chown -R node:node /app
# Switch to non-root user
USER node
EXPOSE 3000
CMD ["node", "server.js"]