-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
35 lines (24 loc) · 737 Bytes
/
Dockerfile
File metadata and controls
35 lines (24 loc) · 737 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
# base image
FROM node:20.11.1-alpine3.19 AS build
# set working directory
WORKDIR /app
# exposing all our Node.js binaries
ENV PATH=/app/node_modules/.bin:$PATH
# Copy package.json
COPY package.json /app/package.json
# npm install
RUN npm install
# add app
COPY . /app
# build app
RUN npm run build
FROM nginx:latest
# Remove default nginx static resources
RUN rm /etc/nginx/conf.d/default.conf
#copies React to the container directory
COPY nginx/nginx.conf /etc/nginx/conf.d
# Set working directory to nginx resources directory
COPY --from=build /app/dist /usr/share/nginx/html
EXPOSE 80
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]