Use proper build flags and enable gzip compression in nginx

master
Nikola Forró 6 years ago
parent 14bd816108
commit 363a0c7cce

@ -8,7 +8,7 @@ RUN npm install && mkdir /gifted-subs && cp -r node_modules/ /gifted-subs
WORKDIR /gifted-subs WORKDIR /gifted-subs
COPY apps/gifted-subs . COPY apps/gifted-subs .
RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none RUN $(npm bin)/ng build --target=production --environment=prod --aot --build-optimizer --output-hashing=none
WORKDIR /build-regular-subs WORKDIR /build-regular-subs
COPY apps/regular-subs/package.json apps/regular-subs/package-lock.json ./ COPY apps/regular-subs/package.json apps/regular-subs/package-lock.json ./
@ -18,7 +18,7 @@ RUN npm install && mkdir /regular-subs && cp -r node_modules/ /regular-subs
WORKDIR /regular-subs WORKDIR /regular-subs
COPY apps/regular-subs . COPY apps/regular-subs .
RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none RUN $(npm bin)/ng build --target=production --environment=prod --aot --build-optimizer --output-hashing=none
WORKDIR /build-quotes WORKDIR /build-quotes
COPY apps/quotes/package.json apps/quotes/package-lock.json ./ COPY apps/quotes/package.json apps/quotes/package-lock.json ./
@ -28,7 +28,7 @@ RUN npm install && mkdir /quotes && cp -r node_modules/ /quotes
WORKDIR /quotes WORKDIR /quotes
COPY apps/quotes . COPY apps/quotes .
RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none RUN $(npm bin)/ng build --target=production --environment=prod --aot --build-optimizer --output-hashing=none
WORKDIR /build-schedule WORKDIR /build-schedule
COPY apps/schedule/package.json apps/schedule/package-lock.json ./ COPY apps/schedule/package.json apps/schedule/package-lock.json ./
@ -38,7 +38,7 @@ RUN npm install && mkdir /schedule && cp -r node_modules/ /schedule
WORKDIR /schedule WORKDIR /schedule
COPY apps/schedule . COPY apps/schedule .
RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none RUN $(npm bin)/ng build --target=production --environment=prod --aot --build-optimizer --output-hashing=none
WORKDIR /build-twitch-logs WORKDIR /build-twitch-logs
COPY apps/twitch-logs/package.json apps/twitch-logs/package-lock.json ./ COPY apps/twitch-logs/package.json apps/twitch-logs/package-lock.json ./
@ -48,7 +48,7 @@ RUN npm install && mkdir /twitch-logs && cp -r node_modules/ /twitch-logs
WORKDIR /twitch-logs WORKDIR /twitch-logs
COPY apps/twitch-logs . COPY apps/twitch-logs .
RUN $(npm bin)/ng build --prod --build-optimizer --output-hashing=none RUN $(npm bin)/ng build --target=production --environment=prod --aot --build-optimizer --output-hashing=none
FROM nginx:alpine FROM nginx:alpine

@ -21,11 +21,17 @@ http {
access_log /var/log/nginx/access.log main; access_log /var/log/nginx/access.log main;
sendfile on; sendfile on;
#tcp_nopush on; tcp_nodelay on;
tcp_nopush on;
keepalive_timeout 65; keepalive_timeout 65;
gzip on; gzip on;
gzip_http_version 1.1;
gzip_vary on;
gzip_comp_level 6;
gzip_proxied any;
gzip_types text/plain text/html text/css application/json application/javascript application/x-javascript text/javascript text/xml application/xml application/rss+xml application/atom+xml application/rdf+xml;
server { server {
listen 80; listen 80;

Loading…
Cancel
Save