This commit is contained in:
Fedor Katurov 2022-11-02 11:58:45 +06:00
commit 5104c2518b
34 changed files with 6844 additions and 0 deletions

11
docker/Dockerfile Normal file
View file

@ -0,0 +1,11 @@
FROM node:16-alpine as builder
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn
COPY . .
RUN yarn generate
FROM nginx
COPY docker/nginx.conf /etc/nginx/nginx.conf
COPY --from=builder /app/dist /usr/share/nginx/html

54
docker/nginx.conf Normal file
View file

@ -0,0 +1,54 @@
worker_processes 4;
events {
worker_connections 1024;
}
http {
server {
listen 80;
root /usr/share/nginx/html;
include /etc/nginx/mime.types;
gzip on;
gzip_min_length 1000;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain application/xml application/javascript;
## All static files will be served directly.
location ~* ^.+\.(?:css|cur|js|jpe?g|gif|htc|ico|png|xml|otf|ttf|eot|woff|woff2|svg)$ {
access_log off;
expires 1d;
add_header Cache-Control public;
gzip_static on;
## No need to bleed constant updates. Send the all shebang in one
## fell swoop.
tcp_nodelay off;
## Set the OS file cache.
open_file_cache max=3000 inactive=120s;
open_file_cache_valid 45s;
open_file_cache_min_uses 2;
open_file_cache_errors off;
}
location / {
# try_files $uri @index;
index index.html;
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;
}
location @index {
add_header Cache-Control "no-store, no-cache, must-revalidate";
expires -1;
try_files /index.html =404;
}
}
}