This commit is contained in:
tyuXX 2026-10-21 17:27:53 +00:00
commit 5577214005
22 changed files with 4997 additions and 0 deletions

41
Dockerfile Normal file
View file

@ -0,0 +1,41 @@
# ----------------------------------------------------
# Stage 1: Build TypeScript Application
# ----------------------------------------------------
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm install
COPY tsconfig.json ./
COPY src/ ./src/
COPY views/ ./views/
COPY public/ ./public/
RUN npm run build
# ----------------------------------------------------
# Stage 2: Production Runtime
# ----------------------------------------------------
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV PORT=3000
COPY package*.json ./
RUN npm install --omit=dev
# Copy compiled code and assets from builder
COPY --from=builder /app/dist ./dist
COPY views/ ./views
COPY public/ ./public
# Ensure local data directory exists for persistent JSON db
RUN mkdir -p /app/data
EXPOSE 3000
CMD ["node", "dist/server.js"]