Updated dockerfile frontend

This commit is contained in:
2023-02-20 14:30:47 +01:00
parent de1c201ffc
commit b8f0080728

View File

@@ -9,17 +9,27 @@ RUN npm install --silent
COPY . . COPY . .
RUN npm run build # set working directory
# Production environment
FROM node:14.17.6-alpine3.14
WORKDIR /app WORKDIR /app
COPY --from=build /app/build . # Copies package.json and package-lock.json to Docker environment
COPY package*.json ./
# Installs all node packages
RUN npm install
# Copies everything over to Docker environment
COPY . .
# Build for production.
RUN npm run build --production
# Install `serve` to run the application.
RUN npm install -g serve RUN npm install -g serve
# Uses port which is used by the actual application
EXPOSE 5000 EXPOSE 5000
CMD ["serve", "-s", "build"] # Run application
#CMD [ "npm", "start" ]
CMD serve -s build