updated the dockerfile

This commit is contained in:
philipcheung 2025-03-16 21:34:50 +08:00
parent d1c944f58a
commit 47fe4f337d
1 changed files with 0 additions and 29 deletions

View File

@ -1,22 +1,3 @@
FROM node:18-alpine
WORKDIR /app
COPY package.json .
RUN npm installFROM node:18-alpine as build
WORKDIR /app
# Copy package files and install dependencies
COPY package.json package-lock.json* ./
RUN npm ci
# Copy all files
COPY . .
# Build the application
RUN npm run build
# Production stage
FROM node:18-alpine as production
@ -32,13 +13,3 @@ EXPOSE 3000
# Use the -s flag to handle SPA routing
CMD ["serve", "-s", "dist", "-l", "3000"]
RUN npm install -g serve
COPY . .
RUN npm run build
EXPOSE 3000
# Serve the static files after building
CMD ["serve", "-s", "dist", "-l", "3000"]