This commit is contained in:
2026-05-26 16:50:34 +08:00
parent f4f2393f72
commit 165e97bff7
5 changed files with 198 additions and 0 deletions

27
Dockerfile Normal file
View File

@@ -0,0 +1,27 @@
# Multi-stage Dockerfile for wsmud
FROM node:18-alpine AS build
WORKDIR /app
# copy package and lock first for faster rebuilds
COPY package.json package-lock.json* ./
RUN npm ci --omit=dev || npm i --no-audit
# copy full source and build frontend with vite
COPY . .
RUN npm run build || true
FROM node:18-alpine AS runtime
WORKDIR /app
# create folder for logs and db
RUN mkdir -p /app/log /app/data /app/www
# copy node_modules from build stage
COPY --from=build /app/node_modules ./node_modules
COPY --from=build /app/www ./www
COPY --from=build /app .
ENV NODE_ENV=production
EXPOSE 80
CMD ["node", "web.js"]