Initial commit with Dockerfile and demo code
This commit is contained in:
+31
@@ -0,0 +1,31 @@
|
||||
# Stage 1: Build web frontend
|
||||
FROM node:20-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
# Copy dependency manifests for workspace caching
|
||||
COPY package.json package-lock.json ./
|
||||
COPY server/package.json ./server/
|
||||
COPY web/package.json ./web/
|
||||
|
||||
# Install all dependencies (including devDependencies for Vite)
|
||||
RUN npm ci
|
||||
|
||||
# Copy application source
|
||||
COPY . .
|
||||
|
||||
# Build frontend to web/dist
|
||||
RUN npm run build
|
||||
|
||||
# Stage 2: Production runner
|
||||
FROM node:20-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=8787
|
||||
|
||||
# Copy app files from builder
|
||||
COPY --from=builder /app ./
|
||||
|
||||
EXPOSE 8787
|
||||
|
||||
CMD ["node", "server/index.js"]
|
||||
Reference in New Issue
Block a user