blob: 2e6442aee62a67653a156af604b34643e57b8717 [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 +080015
Kate Hsuanf32825f2020-03-27 06:49:15 +000016RUN groupadd -r datalake && useradd -r -g datalake datalake
Ekko Chang5919a142019-05-13 18:41:30 +080017
18COPY --from=builder /app/dist/* /usr/share/nginx/html/
19COPY --from=builder /app/dl-admin-nginx.conf /etc/nginx/conf.d/default.conf
Kate Hsuanf32825f2020-03-27 06:49:15 +000020COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf
Ekko Chang5919a142019-05-13 18:41:30 +080021
Kate Hsuanf32825f2020-03-27 06:49:15 +000022RUN chown -R datalake:datalake /etc/nginx
23RUN chown -R datalake:datalake /var/cache/nginx
24
25
26USER datalake
27
28#CMD echo "domain-needed" >> /etc/dnsmasq.conf && \
29# echo "resolv-file=/etc/resolv.conf" >> /etc/dnsmasq.conf && \
30# echo "expand-hosts" >> /etc/dnsmasq.conf && \
31# echo "listen-address=127.0.0.1" >> /etc/dnsmasq.conf && \
32# service dnsmasq restart && \
33# 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 && \
34# nginx -g "daemon off;"
35
36CMD echo resolver `grep nameserver /etc/resolv.conf |awk {'print $2'}` valid=10s\; > /etc/nginx/resolver.conf && \
37 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 && \
38 nginx -g "daemon off;"
Kate Hsuana4def1d2020-03-17 03:46:32 +000039
40#CMD ["sh", "-c", "tail -f /dev/null"]