forked from fabnumdef/chatbot-front
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
29 lines (27 loc) · 1.09 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
### STAGE 1:BUILD BACKOFFICE ###
# Defining a node image to be used as giving it an alias of "build"
# Which version of Node image to use depends on project dependencies
# This is needed to build and compile our code
# while generating the docker image
FROM node:18-alpine AS build
# Create a Virtual directory inside the docker image
WORKDIR /dist/src/app
# Copy files to virtual directory
# COPY package.json package-lock.json ./
# Run command in Virtual directory
RUN npm cache clean --force
# Copy files from local machine to virtual directory in docker image
COPY . .
RUN npm ci
RUN npm run build:prod
### STAGE 2:RUN ###
# Defining nginx image to be used
FROM nginx:latest AS nginx
# Copying compiled code and nginx config to different folder
# NOTE: This path may change according to your project's output folder
COPY --from=build /dist/src/app/dist/chatbot-front /var/www/chatbot-front
COPY --from=build /dist/src/app/dist/webchat /var/www/webchat
COPY nginx.conf /etc/nginx/conf.d/default.conf
# Exposing a port, here it means that inside the container
# the app will be using Port 80 while running
EXPOSE 80