-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (22 loc) · 814 Bytes
/
Dockerfile
File metadata and controls
36 lines (22 loc) · 814 Bytes
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
30
31
32
33
34
35
36
FROM node:lts-alpine3.18 as build-stage
# make the 'app' folder the current working directory
WORKDIR /Popcorn-web
# copy both 'package.json' and 'package-lock.json' (if available)
COPY package*.json ./
# install project dependencies
RUN npm install
# copy project files and folders to the current working directory (i.e. 'app' folder)
COPY . .
# build app for production with minification
RUN npm run build
# production stage
FROM nginx:stable-alpine3.17 as production-stage
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
# Remove default nginx index page
RUN rm -rf /usr/share/nginx/html/*
COPY --from=build-stage /Popcorn-web/dist /usr/share/nginx/html
RUN apk add --no-cache tzdata
ENV TZ Asia/Kolkata
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime
EXPOSE 8081
CMD ["nginx", "-g", "daemon off;"]