update Dockerfile/nginx.conf, add .env.production

This commit is contained in:
Dawid Wysokiński 2021-04-17 08:31:19 +02:00
parent 5c985e5edc
commit 10c684d2b2
3 changed files with 3 additions and 4 deletions

2
.env.production Normal file
View File

@ -0,0 +1,2 @@
REACT_APP_API_URI=https://api.zdamegzaminzawodowy.pl/graphql
REACT_APP_CDN_URI=https://cdn.zdamegzaminzawodowy.pl/

View File

@ -1,6 +1,5 @@
FROM node:14.1.0-alpine as build-deps
#Stage 1
WORKDIR /usr/src/app
@ -12,7 +11,7 @@ RUN yarn build
#Stage 2
FROM nginx:1.17.5-alpine
FROM nginx:1.18-alpine
COPY --from=build-deps /usr/src/app/build /var/www
COPY nginx.conf /etc/nginx/nginx.conf
EXPOSE 80

View File

@ -36,14 +36,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";
}