Skip to content

Commit

Permalink
ci: improve Dockerfile (#371)
Browse files Browse the repository at this point in the history
  • Loading branch information
meziaris authored Mar 7, 2022
1 parent 222bd6f commit 869fcc8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.git
.github
.maintain
!.maintain/docker/nginx/
11 changes: 7 additions & 4 deletions .maintain/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# 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
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="[email protected]"
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;"]
File renamed without changes.
8 changes: 1 addition & 7 deletions nginx/nginx.conf → .maintain/docker/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -25,9 +22,6 @@ http {
#tcp_nopush on;

keepalive_timeout 65;

#gzip on;

gzip on;
include /etc/nginx/conf.d/*.conf;
}

0 comments on commit 869fcc8

Please sign in to comment.