-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
51 lines (42 loc) · 1.79 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
############################################################
# Dockerfile to build PhenoMeNal Portal images
############################################################
# Set the base image to node
FROM node:8.16.0
# File Author / Maintainer
MAINTAINER PhenoMeNal-H2020 Project ( [email protected] )
# container version
ENV version="1.3"
# software version
ENV software_version="3.2.2"
# Metadata
LABEL Description="PhenoMeNal Portal main container"
LABEL software="PhenoMeNal Portal"
LABEL website="https://portal.phenomenal-h2020.eu/"
LABEL documentation="https://portal.phenomenal-h2020.eu/"
LABEL license="https://github.com/phnmnl/container-phenomenal-portal/blob/master/License.txt"
LABEL tags="Cloud deployment"
LABEL version="${version}"
LABEL software.version="${software_version}"
# Optional arguments to choose the Git repo & branch to use at build time
ARG git_repo=phnmnl/ng2-phenomenal-portal
ARG git_branch="v${software_version}"
# Install software requirements
RUN apt-get -y update && apt-get install --no-install-recommends -y nginx git jq unzip && \
npm uninstall @angular/cli -g && \
npm install typings -g && \
npm cache clean --force && npm install -g @angular/[email protected] && \
apt-get autoremove -y && apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Clone git repository
RUN echo "Cloning branch '${git_branch}' of the Git repository '${git_repo}'" >&2 && \
git clone --depth 1 --single-branch -b ${git_branch} https://github.com/${git_repo}.git
# Build and deploy the portal
WORKDIR /ng2-phenomenal-portal
RUN npm install && ng build --prod --env=prod
RUN cp -r dist/* /usr/share/nginx/html
COPY setup_backend_host.sh setup_backend_host.sh
RUN chmod u+x setup_backend_host.sh
COPY ./default /etc/nginx/sites-enabled
# Ports
EXPOSE 80