-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
28 lines (22 loc) · 819 Bytes
/
Dockerfile
File metadata and controls
28 lines (22 loc) · 819 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
# This Dockerfile builds and deploys a production ready version of your ReactJS App.
# This could be automated using GitHub Actions to build the project and deliver it to Docker Hub.
# pull official base image
FROM node:13.12.0-alpine as build
# set working directory
WORKDIR /app
# add `/app/node_modules/.bin` to $PATH
ENV PATH /app/node_modules/.bin:$PATH
# install app dependencies
COPY package.json ./
COPY package-lock.json ./
RUN npm install --silent
RUN npm install react-scripts@3.4.1 -g --silent
# add app
COPY . ./
RUN npm run build
# this next stage is the final deliverable. It is just a simple
# apache2 server with our built application (build/) being served on port 80.
# production stage
FROM httpd:2.4-alpine as production-stage
COPY --from=build /app/build /usr/local/apache2/htdocs/
EXPOSE 80