Add docker stuff

This commit is contained in:
Mathis 2021-01-05 12:28:07 +01:00
parent cafa4d9640
commit e516c81f03
3 changed files with 37 additions and 6 deletions

View File

@ -1,8 +1,6 @@
node_modules
node_modules/
npm-debug.log
yarn-error.log
build
public
content
config
.git
public/
.git/
.cache/

12
docker/Dockerfile Normal file
View File

@ -0,0 +1,12 @@
FROM node:13.8.0 as front
WORKDIR /app
COPY ./ /app/
RUN yarn install
RUN yarn run build
FROM nginx:1.17.8-alpine
RUN rm -rf /usr/share/nginx/html
COPY --from=front /app/public/ /usr/share/nginx/html
COPY default.conf /etc/nginx/conf.d/default.conf

21
docker/default.conf Normal file
View File

@ -0,0 +1,21 @@
server {
listen 80;
root /usr/share/nginx/html;
index index.html;
autoindex off;
charset urtf-8;
error_page 404 /404.html;
access_log /var/log/nginx/access.log;
location ~* \.(html)$ {
add_header Cache-Control "no-store";
expires off;
}
rewrite ^([^.\?]*[^/])$ $1/ permanent;
try_files $uri $uri/ $uri/index.html =404;
}