summaryrefslogtreecommitdiffstats
path: root/components
diff options
context:
space:
mode:
authorKate Hsuan <kate.hsuan@qct.io>2020-08-06 02:10:12 +0000
committerKate Hsuan <kate.hsuan@qct.io>2020-08-13 09:04:56 +0000
commit5ae68c251200a093254c926bb35fa953ae3b5697 (patch)
tree8177f4f7a69480a0e0f12f9e7af7ed858ea1222c /components
parentfe4b8cd07dad6f087e62456a9eccac58f542017f (diff)
[Datalake] Output logs to stdout.1.1.0-datalake-handler-admin-ui
Issue-ID: DCAEGEN2-2371 Issue-ID: DCAEGEN2-2379 Signed-off-by: Kate Hsuan <kate.hsuan@qct.io> Change-Id: I4c3eb0d80c653ff95da2cb14cd15d864df86c095
Diffstat (limited to 'components')
-rw-r--r--components/datalake-handler/admin/Dockerfile16
-rw-r--r--components/datalake-handler/admin/nginx/nginx.conf7
-rw-r--r--components/datalake-handler/admin/nginx/run.sh5
3 files changed, 13 insertions, 15 deletions
diff --git a/components/datalake-handler/admin/Dockerfile b/components/datalake-handler/admin/Dockerfile
index 2e6442ae..6237741a 100644
--- a/components/datalake-handler/admin/Dockerfile
+++ b/components/datalake-handler/admin/Dockerfile
@@ -18,23 +18,15 @@ 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
+COPY --from=builder /app/run.sh /tmp
RUN chown -R datalake:datalake /etc/nginx
RUN chown -R datalake:datalake /var/cache/nginx
+RUN chown -R datalake:datalake /tmp/run.sh
+RUN chmod 0744 /tmp/run.sh
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 ["sh", "-c", "/tmp/run.sh"]
-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"]
diff --git a/components/datalake-handler/admin/nginx/nginx.conf b/components/datalake-handler/admin/nginx/nginx.conf
index 8613dff5..731935d8 100644
--- a/components/datalake-handler/admin/nginx/nginx.conf
+++ b/components/datalake-handler/admin/nginx/nginx.conf
@@ -1,8 +1,9 @@
-user nginx;
+user datalake;
worker_processes 1;
-error_log /tmp/error.log warn;
pid /tmp/nginx.pid;
+error_log stderr warn;
+#access_log /dev/stdout http;
events {
@@ -18,7 +19,7 @@ http {
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
- access_log /tmp/access.log main;
+ access_log /dev/stdout main;
sendfile on;
#tcp_nopush on;
diff --git a/components/datalake-handler/admin/nginx/run.sh b/components/datalake-handler/admin/nginx/run.sh
new file mode 100644
index 00000000..b638807f
--- /dev/null
+++ b/components/datalake-handler/admin/nginx/run.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+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;"