-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
46 lines (33 loc) · 1.05 KB
/
Dockerfile
File metadata and controls
46 lines (33 loc) · 1.05 KB
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
37
38
39
40
41
42
43
44
45
46
# 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
COPY package-lock.json /app/package-lock.json
# npm install
RUN npm install
# add app
COPY . /app
# build arguments for env variables
ARG REACT_APP_NAVER_MAP_CLIENT_ID
# set environment variables
ENV REACT_APP_NAVER_MAP_CLIENT_ID=$REACT_APP_NAVER_MAP_CLIENT_ID
# build arguments for env variables
ARG REACT_APP_NAVER_MAP_API_KEY
# set environment variables
ENV REACT_APP_NAVER_MAP_API_KEY=$REACT_APP_NAVER_MAP_API_KEY
# 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/build /usr/share/nginx/html
EXPOSE 80
# Containers run nginx with global directives and daemon off
ENTRYPOINT ["nginx", "-g", "daemon off;"]