configs_collection/t1/front_dockerized/Dockerfile
2024-11-02 14:05:10 +03:00

19 lines
607 B
Docker

# Use Node.js LTS image as base
FROM node:21-alpine as build
WORKDIR /app
ENV PATH /app/node_modules/.bin:$PATH
COPY ./reactapp/package.json /app/package.json
RUN npm config --global set 'registry=https://nexuswatchman.t1-consulting.ru/repository/npm-group/'
RUN npm config --global set 'fund=false'
RUN npm install react-scripts@3.0.1 -g --silent
RUN npm install
# Create environment file
COPY ./reactapp/ /app
RUN npm run build
FROM nginx:stable-alpine
COPY --from=build /app/dist usr/share/nginx/html
COPY ./nginx/nginx.conf /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]