Move static files to proxy container
Signed-off-by: Fred Boniface <fred@fjla.uk>
This commit is contained in:
parent
fa1597855c
commit
94063af0e4
@ -8,3 +8,4 @@ nginx-proxy-docker
|
|||||||
README.md
|
README.md
|
||||||
LICENSE
|
LICENSE
|
||||||
UpNext.md
|
UpNext.md
|
||||||
|
static
|
@ -2,6 +2,6 @@ FROM node:19
|
|||||||
EXPOSE 8460
|
EXPOSE 8460
|
||||||
WORKDIR /usr/src/app
|
WORKDIR /usr/src/app
|
||||||
COPY ./package*.json ./
|
COPY ./package*.json ./
|
||||||
RUN npm ci --only=production
|
RUN npm ci --omit=dev
|
||||||
COPY . .
|
COPY . .
|
||||||
CMD [ "node", "app.js" ]
|
CMD [ "node", "app.js" ]
|
||||||
|
@ -1,3 +0,0 @@
|
|||||||
FROM nginx:mainline-alpine-slim
|
|
||||||
RUN rm /etc/nginx/nginx.conf
|
|
||||||
COPY ./nginx.conf /etc/nginx/nginx.conf
|
|
2
static/.dockerignore
Normal file
2
static/.dockerignore
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
.dockerignore
|
||||||
|
Dockerfile
|
18
static/Dockerfile
Normal file
18
static/Dockerfile
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
FROM fedora:latest as compressor
|
||||||
|
RUN dnf install brotli -y
|
||||||
|
COPY . /data/
|
||||||
|
RUN rm -r /data/nginx
|
||||||
|
#RUN brotli -q 9 /data/*.json
|
||||||
|
RUN gzip -k -9 /data/*.json
|
||||||
|
#RUN brotli -q 9 /data/styles/*.css
|
||||||
|
RUN gzip -k -9 /data/styles/*.css
|
||||||
|
#RUN brotli -q 9 /data/js/*.js
|
||||||
|
RUN gzip -k -9 /data/js/*.js
|
||||||
|
#RUN brotli -q 9 /data/*.html
|
||||||
|
RUN gzip -k -9 /data/*.html
|
||||||
|
|
||||||
|
FROM nginx:mainline-alpine-slim
|
||||||
|
#RUN apk add nginx-mod-http-brotli
|
||||||
|
RUN rm /etc/nginx/nginx.conf
|
||||||
|
COPY ./nginx/nginx.conf /etc/nginx/nginx.conf
|
||||||
|
COPY --from=compressor /data/ /site-static/
|
@ -1,5 +1,5 @@
|
|||||||
user nginx;
|
user nginx;
|
||||||
worker_processes auto;
|
worker_processes 1;
|
||||||
|
|
||||||
error_log /var/log/nginx/error.log notice;
|
error_log /var/log/nginx/error.log notice;
|
||||||
pid /var/run/nginx.pid;
|
pid /var/run/nginx.pid;
|
||||||
@ -29,10 +29,9 @@ http {
|
|||||||
proxy_cache owl_cache;
|
proxy_cache owl_cache;
|
||||||
|
|
||||||
location / {
|
location / {
|
||||||
proxy_pass http://localhost:8460;
|
root /site-static/;
|
||||||
proxy_cache_key $scheme://$host$uri$is_args$query_string;
|
index index.html;
|
||||||
proxy_ignore_headers Cache-Control;
|
gzip_static on;
|
||||||
proxy_cache_valid 200 10080m;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api/ {
|
location /api/ {
|
Reference in New Issue
Block a user