-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
101 lines (76 loc) · 2.71 KB
/
Dockerfile
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
ARG NODE_IMAGE_TAG=node:14
# ========================================
# Landing page
# ========================================
FROM $NODE_IMAGE_TAG as landing-build
WORKDIR /app
# Install dependencies
COPY landing/package.json landing/yarn.lock ./
RUN yarn install
# Build landing page
COPY landing ./
RUN yarn build
# ==================================================================
# Angular app dependencies by default used for local development
# ==================================================================
FROM $NODE_IMAGE_TAG as angular-deps
WORKDIR /app
# Install dependencies
COPY package.json yarn.lock ./
ARG YARN_INSTALL_OPTS
RUN yarn install ${YARN_INSTALL_OPTS}
# build time arguments for Angular environment
ARG ANGULAR_CONFIG=development
ARG CLIENT_VERSION=undefined
# default enviroment presets
ENV ENVIRONMENT_CONFIG $ANGULAR_CONFIG
# ========================================
# Angular app bundle build
# ========================================
FROM angular-deps as angular-build
# build time arguments for Angular environment
ARG ANGULAR_CONFIG=production
ARG CLIENT_VERSION=undefined
# Copy the code and build the app bundle
COPY src ./src
COPY tslint ./tslint
COPY e2e ./e2e
COPY *.json browserslist ./
RUN sed -i "s/__VERSION__/${CLIENT_VERSION}/" src/environments/environment.ts
RUN yarn build --configuration=$ANGULAR_CONFIG --aot --output-path=dist
# When targeting this image stage, run angulat dev server
EXPOSE 4200
HEALTHCHECK --interval=5m --timeout=10s \
CMD curl -f localhost:4200 || exit 1
CMD yarn dev-start
# ========================================
# Runtime stage - NGINX
# ========================================
FROM nginx:1.25.1
LABEL app=kg-prototypes
WORKDIR /usr/share/nginx/html
# URL to proxy requests to /api
ENV APPSERVER_UPSTREAM http://appserver:5000
# Whether to run the app in prod mode
ENV PRODUCTION_MODE true
# Whether we are running with valid KEGG license
ENV KEGG_ENABLED false
# Whether to run the app with oauth login
ENV OAUTH_ENABLED false
# OAuth issuer discovert URL
ENV OAUTH_ISSUER ""
# Client ID of the OAuth application
ENV OAUTH_CLIENT_ID ""
# List of space delimited list of non-stantdard MIME types
# which are known to benefit from gzip compression (text based content)
ENV GZIP_EXTRA_TYPES text/tsv vnd.lifelike.document/bioc vnd.lifelike.document/enrichment-table vnd.lifelike.document/graph vnd.lifelike.document/map
# build time argument for Angular environment
ARG ANGULAR_CONFIG=production
# default enviroment presets
ENV ENVIRONMENT_CONFIG $ANGULAR_CONFIG
# Copy nginx configuraiton template
COPY nginx.conf /etc/nginx/templates/default.conf.template
# Copy built assets
COPY --from=landing-build /app/dist ./
COPY --from=angular-build /app/dist ./
EXPOSE 80