From 145fdc69223d30a4d0898ff2a9d454c5394c0848 Mon Sep 17 00:00:00 2001 From: manisha Date: Jul 15 2021 13:11:08 +0000 Subject: dockerfile modified --- diff --git a/Dockerfile b/Dockerfile index f721f93..9ed7a09 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,16 +1,13 @@ -FROM node:8 as react-build +FROM quay.io/bitnami/node:10 as react-build WORKDIR /app COPY . ./ -RUN chmod -v +x ./start.sh RUN yarn RUN yarn build - - -FROM nginx:alpine -RUN sed -i.bak 's/^user/#user/' /etc/nginx/nginx.conf -COPY nginx.conf /etc/nginx/conf.d/default.conf -COPY --from=react-build /app/build /usr/share/nginx/html -RUN chmod g+rwx /var/cache/nginx /var/run /var/log/nginx /usr/share/nginx/html -COPY --from=react-build /app/start.sh /start.sh -EXPOSE 8000 -CMD ["/start.sh"] +RUN sed -i "s#SUBDIR: '.*',#SUBDIR: '${SUBDIR:-/}',#" /app/build/env.js && \ + sed -i "s#API: '.*'#API: '${API:-https://packager-dashboard.stg.fedoraproject.org/api/v1/}'#" /app/build/env.js + + +FROM quay.io/bitnami/nginx +COPY nginx.conf /opt/bitnami/nginx/conf/server_blocks/nginx_packager_dashboard.conf +COPY --from=react-build /app/build /app +EXPOSE 8000 \ No newline at end of file diff --git a/nginx.conf b/nginx.conf index 9084fbc..76a6b6e 100644 --- a/nginx.conf +++ b/nginx.conf @@ -1,15 +1,23 @@ + server { listen 8000; server_name localhost; - root /usr/share/nginx/html; - + root /app; + location / { index index.html; try_files $uri /index.html; + + # kill cache + add_header Last-Modified $date_gmt; + add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; + if_modified_since off; + expires off; + etag off; } - + error_page 500 502 503 504 /50x.html; location = /50x.html { - root /usr/share/nginx/html; + root /app; } -} +} \ No newline at end of file