blob: 38c50a655ae9b0ba8a31a825622977eaa891675e [file] [log] [blame]
Ekko Chang5919a142019-05-13 18:41:30 +08001FROM node:alpine AS builder
2MAINTAINER Ekko Chang <ekko.chang@qct.io>
3
4LABEL org.label-schema.docker.build="docker build -t dl-admin . --no-cache" \
5 org.label-schema.docker.run="docker run -p 80:80 --add-host=dl_feeder:your_feeder_ipaddress dl-admin"
6
7WORKDIR /app
8COPY ./src .
9COPY ./nginx .
10RUN npm install && \
11 npm run build
12
13
Kate Hsuana4def1d2020-03-17 03:46:32 +000014FROM nginx:1.17.9
Ekko Chang5919a142019-05-13 18:41:30 +080015RUN apt-get update && \
Kate Hsuana4def1d2020-03-17 03:46:32 +000016 apt-get install -y dnsmasq
Ekko Chang5919a142019-05-13 18:41:30 +080017
18RUN echo "\n\n# Docker extra config \nuser=root\naddn-hosts=/etc/hosts\n" >> /etc/dnsmasq.conf
19
20COPY --from=builder /app/dist/* /usr/share/nginx/html/
21COPY --from=builder /app/dl-admin-nginx.conf /etc/nginx/conf.d/default.conf
22
Kate Hsuana4def1d2020-03-17 03:46:32 +000023CMD echo "domain-needed" >> /etc/dnsmasq.conf && \
24 echo "resolv-file=/etc/resolv.conf" >> /etc/dnsmasq.conf && \
25 echo "expand-hosts" >> /etc/dnsmasq.conf && \
26 echo "listen-address=127.0.0.1" >> /etc/dnsmasq.conf && \
27 service dnsmasq restart && \
28 echo set \$upstreamName http://dl-feeder.`grep search /etc/resolv.conf | awk {'print $2'}`:1680/datalake/v1\$1\$is_args\$args\; > /etc/nginx/upstream.conf && \
29 nginx -g "daemon off;"
30
31#CMD ["sh", "-c", "tail -f /dev/null"]