diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..a10d609 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,3 @@ +node_modules +resources +static/build diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 97a9341..13099ae 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -63,3 +63,13 @@ deploy: RCLONE_CONFIG_PAGES_TYPE: webdav RCLONE_CONFIG_PAGES_URL: https://pages.theorangeone.net RCLONE_CONFIG_PAGES_USER: github + +container: + image: docker:stable + stage: deploy + dependencies: + - build + only: + - master + script: + - docker build -f prod/Dockerfile -t theorangeone.net . diff --git a/prod/Dockerfile b/prod/Dockerfile new file mode 100644 index 0000000..eeaf40e --- /dev/null +++ b/prod/Dockerfile @@ -0,0 +1,5 @@ +FROM nginx:alpine + +COPY prod/nginx.conf /etc/nginx/nginx.conf + +COPY ./public/ /usr/share/nginx/html diff --git a/prod/nginx.conf b/prod/nginx.conf new file mode 100644 index 0000000..fb21a63 --- /dev/null +++ b/prod/nginx.conf @@ -0,0 +1,41 @@ +user nginx; +worker_processes auto; + +error_log stderr; +pid /var/run/nginx.pid; + + +events { + worker_connections 1024; +} + + +http { + include /etc/nginx/mime.types; + default_type application/octet-stream; + + access_log /dev/stdout; + + sendfile on; + + keepalive_timeout 65; + + gzip on; + + server { + listen 80; + server_name localhost; + + location / { + root /usr/share/nginx/html; + index index.html index.htm; + } + + error_page 404 /404.html; + + error_page 500 502 503 504 /50x.html; + location = /50x.html { + root /usr/share/nginx/html; + } + } +}