-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (24 loc) · 786 Bytes
/
Copy pathDockerfile
File metadata and controls
36 lines (24 loc) · 786 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
# Pull official base image
FROM node:21-alpine3.19 as build-deps
# A directory within the virtualized Docker environment
# Becomes more relevant when using Docker Compose later
WORKDIR /usr/src/app
# Copies package.json and package-lock.json to Docker environment
COPY package*.json ./
RUN ls
ENV NODE_OPTIONS="--openssl-legacy-provider"
# Installs all node packages
RUN npm install
COPY ./ ./
# Installs all node packages
RUN npm run build
# the base image
FROM nginx:1.24-alpine
# Set working directory to nginx asset directory
WORKDIR /usr/share/nginx/html
# Copy static assets from builder stage
COPY --from=build-deps /usr/src/app/build .
## Expose Port
EXPOSE 80
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]