This repository has been archived by the owner on Sep 13, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile
52 lines (39 loc) · 1.47 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
FROM ubuntu:disco AS build
MAINTAINER Ross Golder <[email protected]>
# Set terminal to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i 's/deb-src/# deb-src/' /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade -y -f && \
apt-get install --no-install-recommends -y npm git ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ADD . /build
WORKDIR /build
RUN npm install -g @angular/cli npm@latest && /usr/local/bin/npm install
RUN /usr/local/bin/ng build --prod
FROM ubuntu:disco
# Set terminal to be noninteractive
ENV DEBIAN_FRONTEND noninteractive
RUN sed -i 's/deb-src/# deb-src/' /etc/apt/sources.list
RUN apt-get update && \
apt-get upgrade -y -f && \
apt-get install --no-install-recommends -y nginx ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# forward request and error logs to docker log collector
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
# put nginx config in place
RUN rm -f /etc/nginx/sites-enabled/*
COPY docker/etc/nginx.conf /etc/nginx/sites-available/sdmgr-ui.conf
RUN ln -sf /etc/nginx/sites-available/sdmgr-ui.conf /etc/nginx/sites-enabled/sdmgr-ui.conf
# Tell nginx not to daemonize
RUN echo "daemon off;" >>/etc/nginx/nginx.conf
# Put our static docroot into place
COPY --from=build /build/dist /srv
WORKDIR /srv/sdmgr-ui
EXPOSE 80
COPY docker/entrypoint.sh /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["nginx"]