-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Dockerfile.nginx
57 lines (51 loc) · 1.78 KB
/
Dockerfile.nginx
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
54
55
56
57
# ---- Base ----
FROM --platform=linux/amd64 nginx:1.18.0-alpine AS base
# nginx 1.18.0 uses alpine 3.12
#
# so here is the nodejs search for that version of alpine
# https://pkgs.alpinelinux.org/packages?name=nodejs&branch=v3.12&repo=main
#
RUN apk add --no-cache git curl bash
RUN apk add --no-cache \
--repository http://dl-3.alpinelinux.org/alpine/edge/community \
nodejs=12.22.6-r0 \
npm=12.22.6-r0 \
build-base \
&& npm config set unsafe-perm true \
&& npm install -qg yarn \
&& npm config set unsafe-perm false
WORKDIR /src
# ---- Dependencies ----
FROM base AS dependencies
COPY \
source/SIL.AppBuilder.Portal.Frontend/package.json \
source/SIL.AppBuilder.Portal.Frontend/yarn.lock \
/src/
# Work around 'could not get uid/gid' error during travis build
RUN npm config set unsafe-perm true
RUN yarn
# ---- Build ----
FROM base as build
# defaults
ENV AUTH0_CLIENT_ID n8IAE2O17FBrlQ667x5mydhpqelCBUWG
ENV AUTH0_DOMAIN sil-appbuilder.auth0.com
ENV AUTH0_CONNECTION Username-Password-Authentication
ENV DWKIT_ADMIN_URL http://localhost:7081
ENV NODE_ENV production
ARG SHOW_DEBUG
ARG REVISION
ENV SHOW_DEBUG=$SHOW_DEBUG
ENV REVISION=$REVISION
WORKDIR /src
COPY --from=dependencies /src/node_modules ./node_modules
COPY source/SIL.AppBuilder.Portal.Frontend /src
RUN rm -rf /src/node_modules/semantic-ui-react/index.d.ts
RUN bash -c "/src/scripts/refresh-languages.sh"
RUN yarn webpack:build --output-path /src/_html_tmp
# ---- Release ----
FROM --platform=linux/amd64 nginx:1.18.0-alpine AS release
COPY --from=build /src/_html_tmp /usr/share/nginx/html
COPY source/run-nginx.sh /usr/local/bin
COPY source/config/nginx.conf etc/nginx/conf.d/default.conf.template
COPY source/config/dwkit.conf etc/nginx/conf.d/dwkit.conf.template
CMD ["/usr/local/bin/run-nginx.sh"]