diff --git a/.dockerignore b/.dockerignore index 80bf1452..ec31cc79 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ .git .github .maintain +!.maintain/docker/nginx/ diff --git a/.maintain/docker/Dockerfile b/.maintain/docker/Dockerfile index 571c7076..4c3888fa 100644 --- a/.maintain/docker/Dockerfile +++ b/.maintain/docker/Dockerfile @@ -1,5 +1,5 @@ # build stage -FROM node:16.11.1 as build-stage +FROM node:16.11.1 as builder WORKDIR /app COPY package*.json ./ RUN npm ci @@ -7,9 +7,12 @@ COPY . . RUN npm run build # production stage -FROM nginx:stable-alpine as production-stage +FROM nginx:stable-alpine as runner +LABEL network.debio.image.authors="debio.dev@blocksphere.id" +WORKDIR /usr/share/nginx/html +COPY ./.maintain/docker/nginx/nginx.conf /etc/nginx/nginx.conf RUN rm /etc/nginx/conf.d/default.conf -COPY nginx/conf.d/default.conf /etc/nginx/conf.d/ -COPY --from=build-stage /app/dist /usr/share/nginx/html +COPY ./.maintain/docker/nginx/conf.d/default.conf /etc/nginx/conf.d/default.conf +COPY --from=builder /app/dist /usr/share/nginx/html EXPOSE 80 CMD ["nginx", "-g", "daemon off;"] diff --git a/nginx/conf.d/default.conf b/.maintain/docker/nginx/conf.d/default.conf similarity index 100% rename from nginx/conf.d/default.conf rename to .maintain/docker/nginx/conf.d/default.conf diff --git a/nginx/nginx.conf b/.maintain/docker/nginx/nginx.conf similarity index 96% rename from nginx/nginx.conf rename to .maintain/docker/nginx/nginx.conf index c6451f2e..375e7c4c 100644 --- a/nginx/nginx.conf +++ b/.maintain/docker/nginx/nginx.conf @@ -1,16 +1,13 @@ - user nginx; worker_processes auto; error_log /var/log/nginx/error.log warn; pid /var/run/nginx.pid; - events { worker_connections 1024; } - http { include /etc/nginx/mime.types; default_type application/octet-stream; @@ -25,9 +22,6 @@ http { #tcp_nopush on; keepalive_timeout 65; - - #gzip on; - + gzip on; include /etc/nginx/conf.d/*.conf; } -