forked from microsoft/OCR-Form-Tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
31 lines (24 loc) · 703 Bytes
/
Dockerfile
File metadata and controls
31 lines (24 loc) · 703 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
# Stage 1
FROM node:12 AS build
# Create app directory
WORKDIR /usr/src/app
ENV PATH /usr/src/app/node_modules/.bin:$PATH
# Install app dependencies
# A wildcard is used to ensure both package.json AND package-lock.json are copied
# where available (npm@5+)
COPY package*.json ./
COPY yarn.lock ./
RUN yarn install
COPY . .
# Build the app for production
RUN yarn build
# Stage 2
# Use Nginx to serve files
FROM nginx:1.18.0-alpine
WORKDIR /usr/src/app
COPY --from=build /usr/src/app/run.sh .
COPY --from=build /usr/src/app/build /usr/share/nginx/html
RUN rm /etc/nginx/conf.d/default.conf
COPY --from=build /usr/src/app/nginx.conf /etc/nginx/conf.d/nginx.conf
EXPOSE 80
ENTRYPOINT [ "./run.sh" ]