Init v1.0.0
Some checks failed
Build & Push Docker Image / build (push) Failing after 53s

This commit is contained in:
2026-02-24 18:14:16 +01:00
commit 54d6ee553a
49 changed files with 10410 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 package.json package-lock.json* ./
RUN npm ci
COPY . .
RUN npm run build
# ── Stage 2: Production image ───────────────────────────────────────────────
FROM node:20-alpine
# better-sqlite3 needs build tools for native compilation
RUN apk add --no-cache python3 make g++
WORKDIR /app
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev && npm cache clean --force
# Remove build tools after install to keep image smaller
RUN apk del python3 make g++
# Copy server code
COPY server/ ./server/
# Copy built frontend from builder stage
COPY --from=builder /app/dist ./dist
# Create uploads directory
RUN mkdir -p uploads/avatars
ENV NODE_ENV=production
ENV PORT=3001
ENV SQLITE_PATH=/app/data/redlight.db
EXPOSE 3001
# Data volumes for persistent storage
VOLUME ["/app/uploads", "/app/data"]
CMD ["node", "server/index.js"]