updated the dockerfile
This commit is contained in:
parent
d1c944f58a
commit
47fe4f337d
29
Dockerfile
29
Dockerfile
|
@ -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"]
|
Loading…
Reference in New Issue