updated the dockerfile
This commit is contained in:
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
|
# Production stage
|
||||||
FROM node:18-alpine as production
|
FROM node:18-alpine as production
|
||||||
|
|
||||||
@@ -32,13 +13,3 @@ EXPOSE 3000
|
|||||||
|
|
||||||
# Use the -s flag to handle SPA routing
|
# Use the -s flag to handle SPA routing
|
||||||
CMD ["serve", "-s", "dist", "-l", "3000"]
|
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"]
|
|
Reference in New Issue
Block a user