Skip to content

Commit

Permalink
Deploy to docker hub
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnuk committed May 9, 2020
1 parent a83f7db commit 4f7dc68
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,9 @@ jobs:
npm run build
env:
CI: true
- name: Docker hub publish
uses: elgohr/[email protected]
with:
name: tikui/tikui.org
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM nginxinc/nginx-unprivileged

COPY ./nginx.default.d/. /etc/nginx/conf.d/.

COPY dist /usr/share/nginx/html
53 changes: 53 additions & 0 deletions nginx.default.d/default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
server {
listen 8080;
server_name localhost;
root /usr/share/nginx/html;

location / {
index index.html index.htm;
}

location ~ \.(css|html)$ {
expires epoch;
}

location ~ \.(eot|otf|ttf|woff|woff2)$ {
if ($request_method = 'OPTIONS') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
#
# Custom headers and headers various browsers *should* be OK with but aren't
#
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
#
# Tell client that this pre-flight info is valid for 20 days
#
add_header 'Access-Control-Max-Age' 1728000;
add_header 'Content-Type' 'text/plain; charset=utf-8';
add_header 'Content-Length' 0;
return 204;
}
if ($request_method = 'POST') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
if ($request_method = 'GET') {
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
}
}

error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /usr/share/nginx/html;
}

location /healthcheck {
default_type 'text/plain';
return 200 'OK';
}
}

0 comments on commit 4f7dc68

Please sign in to comment.