1
0
Fork 0
This repository has been archived on 2025-01-15. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
devops-with-docker/Part3/Exercise08/Dockerfile
2023-03-17 12:43:43 +02:00

15 lines
402 B
Docker

FROM node:16.19-alpine3.16 as build-stage
WORKDIR /usr/src/app
COPY package*.json ./
COPY . .
ENV REACT_APP_BACKEND_URL=http://devops:8080
RUN npm install && npm run build
FROM node:16.19-alpine3.16
EXPOSE 5000
WORKDIR /usr/src/app
COPY --from=build-stage /usr/src/app/build /usr/src/app/build
RUN npm install -g serve && \
adduser -D appuser
USER appuser
CMD ["serve", "-s", "-l", "5000", "build"]