DL-Handlers java upgrade from 8 to 11-DCAEGEN2-2286
[dcaegen2/services.git] / components / datalake-handler / admin / Dockerfile
index 38c50a6..2e6442a 100644 (file)
@@ -12,20 +12,29 @@ RUN npm install && \
 
 
 FROM nginx:1.17.9
-RUN apt-get update && \
-    apt-get install -y dnsmasq 
 
-RUN echo "\n\n# Docker extra config \nuser=root\naddn-hosts=/etc/hosts\n" >> /etc/dnsmasq.conf
+RUN groupadd -r datalake && useradd -r -g datalake datalake
 
 COPY --from=builder /app/dist/* /usr/share/nginx/html/
 COPY --from=builder /app/dl-admin-nginx.conf /etc/nginx/conf.d/default.conf
+COPY --from=builder /app/nginx.conf /etc/nginx/nginx.conf
 
-CMD echo "domain-needed" >> /etc/dnsmasq.conf && \
-      echo "resolv-file=/etc/resolv.conf" >> /etc/dnsmasq.conf && \
-      echo "expand-hosts" >> /etc/dnsmasq.conf && \
-      echo "listen-address=127.0.0.1" >> /etc/dnsmasq.conf && \     
-      service dnsmasq restart && \
-      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 && \
-      nginx -g "daemon off;"
+RUN chown -R datalake:datalake /etc/nginx
+RUN chown -R datalake:datalake /var/cache/nginx
+
+
+USER datalake
+
+#CMD echo "domain-needed" >> /etc/dnsmasq.conf && \
+#      echo "resolv-file=/etc/resolv.conf" >> /etc/dnsmasq.conf && \
+#      echo "expand-hosts" >> /etc/dnsmasq.conf && \
+#      echo "listen-address=127.0.0.1" >> /etc/dnsmasq.conf && \     
+#      service dnsmasq restart && \
+#      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 && \
+#      nginx -g "daemon off;"
+
+CMD echo resolver `grep nameserver /etc/resolv.conf |awk {'print $2'}` valid=10s\; > /etc/nginx/resolver.conf && \
+    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 && \
+    nginx -g "daemon off;"
 
 #CMD ["sh", "-c", "tail -f /dev/null"]