update nginx.conf/Dockerfile/circleci config

This commit is contained in:
Dawid Wysokiński 2021-04-24 09:45:49 +02:00
parent df197482b3
commit 72f1582485
3 changed files with 8 additions and 15 deletions

View File

@ -2,11 +2,12 @@ version: 2
jobs:
build:
docker:
- image: circleci/node:12.9.1-browsers
- image: circleci/node:14.16.1-browsers
working_directory: ~/twhelp
steps:
- checkout
- setup_remote_docker
- setup_remote_docker:
version: 20.10.2
# start proprietary DB using private Docker image
# with credentials stored in the UI
- run: |
@ -26,4 +27,3 @@ workflows:
branches:
only:
- master

View File

@ -1,4 +1,4 @@
FROM node:14.1.0-alpine as build-deps
FROM node:14.16.1-alpine as build-deps
#Stage 1
@ -12,8 +12,8 @@ RUN yarn build
#Stage 2
FROM nginx:1.17.5-alpine
FROM nginx:1.20-alpine
COPY --from=build-deps /usr/src/app/build /var/www
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;"]

View File

@ -16,16 +16,11 @@ http {
# what is the default one
default_type application/octet-stream;
# Sets the path, format, and configuration for a buffered log write
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
server {
# listen on port 80
listen 80;
# save logs here
access_log /var/log/nginx/access.log compression;
access_log /var/log/nginx/access.log combined;
# where the root here
root /var/www;
@ -36,14 +31,12 @@ http {
# Fonts and media: images, icons, video, audio, HTC
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|ttf)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
# Javascript and CSS files
location ~* \.(?:css|webmanifest|js|woff2|manifest)$ {
expires 1y;
access_log off;
add_header Cache-Control "public";
}
@ -54,4 +47,4 @@ http {
}
}
}
}