docker build

This commit is contained in:
2024-05-19 16:11:49 +03:00
parent ff649de3d2
commit a17c4d6464
2 changed files with 47 additions and 12 deletions
+22
View File
@@ -0,0 +1,22 @@
#Front
FROM node:18-slim
WORKDIR /usr/local/app
COPY notes-app/package*.json ./
RUN npm i && npm cache clean --force
COPY notes-app/ .
RUN npm run build
#Backend
FROM node:18-slim
WORKDIR /usr/local/app
COPY notes-backend/package*.json ./
RUN npm i && npm cache clean --force
COPY notes-backend/ .
RUN npm run build
#nginx
FROM nginx:alpine
COPY nginx/default.conf /etc/nginx/conf.d/default.conf
COPY --from=build-react /app/build /usr/share/nginx/html
COPY --from=build-node /app/dist /usr/share/nginx/html/api
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]