Skip to content

Commit

Permalink
feat: add docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
valeriansaliou committed Aug 28, 2024
1 parent d089020 commit b6bbc3a
Show file tree
Hide file tree
Showing 5 changed files with 72 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM nginx:1.27-alpine-slim as web

RUN rm -rf /etc/nginx/ /var/www/

COPY ./env/nginx /etc/nginx/
COPY ./build/public /var/www/

EXPOSE 8080/tcp
5 changes: 5 additions & 0 deletions env/nginx/cors.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
add_header Access-Control-Allow-Headers "Content-Type, Origin" always;
add_header Access-Control-Allow-Methods "HEAD, GET, OPTIONS" always;
add_header Access-Control-Allow-Credentials "false" always;
add_header Access-Control-Allow-Origin "*" always;
add_header Access-Control-Max-Age "300" always;
21 changes: 21 additions & 0 deletions env/nginx/mime.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
types {
text/html html;
text/css css;
text/xml xml;
text/plain txt;

application/javascript js;
application/json json;

image/jpeg jpeg jpg;
image/gif gif;
image/png png;
image/svg+xml svg;
image/webp webp;
image/x-icon ico;

audio/webm weba;

font/woff woff;
font/woff2 woff2;
}
17 changes: 17 additions & 0 deletions env/nginx/nginx.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
worker_processes 1;
error_log /dev/stdout info;

events {}

http {
include mime.types;
charset utf-8;
access_log /dev/stdout;

server {
listen 8080;
server_name localhost;

include site.conf;
}
}
21 changes: 21 additions & 0 deletions env/nginx/site.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
root /var/www/;

error_page 404 /404.html;

location ~ ^/((favicon\.ico)|(favicon(-\d+x\d+)?\.png)) {
rewrite ^/(.*) /favicons/$1 break;
}

location = /.well-known/host-meta {
default_type application/xrd+xml;

include cors.conf;
}

location = /.well-known/host-meta.json {
default_type application/jrd+json;

include cors.conf;
}

expires 3h;

0 comments on commit b6bbc3a

Please sign in to comment.