Docerizing and proxying the microservices

This commit is contained in:
Ammar Qaffaf
2024-02-21 16:56:41 -05:00
parent d34bc13d90
commit ff1bb4cc41
7 changed files with 155 additions and 2 deletions

25
Dockerfile Normal file
View File

@ -0,0 +1,25 @@
FROM node:20 as builder
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
COPY . .
RUN npm run build auth
RUN npm run build backend
FROM nginx:alpine
RUN rm /etc/nginx/conf.d/default.conf
COPY nginx.conf /etc/nginx/conf.d
COPY --from=builder /usr/src/app/dist/apps/auth /usr/share/nginx/html/auth
COPY --from=builder /usr/src/app/dist/apps/backend /usr/share/nginx/html/backend
EXPOSE 443
CMD ["nginx", "-g", "daemon off;"]