forked from cityofaustin/janis
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.build
53 lines (39 loc) · 1.46 KB
/
Dockerfile.build
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
47
48
49
50
51
52
53
# ============================================
# Build the files
# ============================================
FROM node:12 AS builder
RUN mkdir -p /app/_dist
WORKDIR /app
ENV NODE_PATH=src
COPY yarn.lock /app/yarn.lock
COPY package.json /app/package.json
RUN yarn
COPY static.config.js /app/static.config.js
COPY .babelrc /app/.babelrc
COPY .storybook /app/.storybook
ARG GOOGLE_ANALYTICS
ENV GOOGLE_ANALYTICS=${GOOGLE_ANALYTICS:-UA-110716917-2}
ARG FEEDBACK_API
ENV FEEDBACK_API=${FEEDBACK_API:-https://coa-test-form-api.herokuapp.com/process/}
ARG CMS_API
ENV CMS_API=${CMS_API:-https://joplin.herokuapp.com/api/graphql}
ARG CMS_MEDIA
ENV CMS_MEDIA=${CMS_MEDIA:-https://joplin-austin-gov.s3.amazonaws.com/media}
ARG CMS_DOCS
ENV CMS_DOCS=${CMS_DOCS:-https://joplin-austin-gov-static.s3.amazonaws.com/production/media/documents}
COPY public /app/public
COPY src /app/src
RUN yarn build
RUN yarn build-storybook
# ============================================
# Serve the built files
# ============================================
FROM openresty/openresty:alpine-fat AS official
COPY --from=builder /app/_dist /usr/local/openresty/nginx/html
COPY --from=builder /app/.out /usr/local/openresty/nginx/html/storybook
COPY deploy/nginx.conf /etc/nginx/conf.d/default.conf
COPY deploy/docker-entrypoint.sh /usr/local/docker-entrypoint.sh
ENV PORT ${PORT:-80}
EXPOSE $PORT
ENTRYPOINT ["/usr/local/docker-entrypoint.sh"]
CMD ["/usr/local/openresty/bin/openresty", "-g", "daemon off;"]