-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
72 lines (53 loc) · 2.12 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
FROM node:latest as builder
LABEL maintainer = "manuel.spuhler@chuv.ch"
WORKDIR /frontend
ADD yarn.lock /frontend
ADD package.json /frontend
RUN yarn install
ENV NODE_PATH=/frontend/node_modules
ENV PATH=$PATH:/frontend/node_modules/.bin
COPY . /frontend
RUN yarn build
FROM nginx:alpine
LABEL maintainer = "manuel.spuhler@chuv.ch"
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ENV DOCKERIZE_VERSION=v0.6.1
RUN apk add --no-cache --update ca-certificates wget openssl bash \
&& update-ca-certificates \
&& wget -O /tmp/dockerize.tar.gz "https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz" \
&& tar -C /usr/local/bin -xzvf /tmp/dockerize.tar.gz \
&& rm -rf /var/cache/apk/* /tmp/*
# Remove Nginx configuration that will be generated by templates
RUN rm -f /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf
# Add nginx config
COPY ./docker/runner/conf/nginx.conf.tmpl \
./docker/runner/conf/proxy.conf.tmpl \
./docker/runner/conf/gzip.conf.tmpl \
./docker/runner/conf/portal-backend-upstream.conf.tmpl \
./docker/runner/conf/config.json.tmpl \
/portal/conf/
COPY docker/runner/run.sh /
# Add front end resources
COPY --from=builder /frontend/build /usr/share/nginx/html/
# Protected files folder
ENV PROTECTED_DIR /protected
RUN mkdir ${PROTECTED_DIR} \
&& chown -R nginx:nginx ${PROTECTED_DIR}
VOLUME [${PROTECTED_DIR}]
EXPOSE 80 443
ENTRYPOINT ["/run.sh"]
LABEL org.label-schema.build-date=$BUILD_DATE \
org.label-schema.name="hbpmip/portal-frontend" \
org.label-schema.description="Nginx server configured to serve the frontend of the MIP portal" \
org.label-schema.url="https://mip.humanbrainproject.eu" \
org.label-schema.vcs-type="git" \
org.label-schema.vcs-url="https://github.com/HBPMedical/portal-frontend" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.version="$VERSION" \
org.label-schema.vendor="LREN CHUV" \
org.label-schema.license="AGPLv3" \
org.label-schema.docker.dockerfile="Dockerfile" \
org.label-schema.memory-hint="10" \
org.label-schema.schema-version="1.0"