Skip to content

Commit 046ab4e

Browse files
committed
Deploy to docker hub
1 parent a83f7db commit 046ab4e

3 files changed

Lines changed: 64 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,9 @@ jobs:
2222
npm run build
2323
env:
2424
CI: true
25+
- name: Docker hub publish
26+
uses: elgohr/Publish-Docker-Github-Action@2.14
27+
with:
28+
name: tikui/tikui.org
29+
username: ${{ secrets.DOCKER_HUB_USERNAME }}
30+
password: ${{ secrets.DOCKER_HUB_TOKEN }}

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FROM nginxinc/nginx-unprivileged
2+
3+
COPY ./nginx.default.d/. /etc/nginx/conf.d/.
4+
5+
COPY dist /usr/share/nginx/html

nginx.default.d/default.conf

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
server {
2+
listen 8080;
3+
server_name localhost;
4+
root /usr/share/nginx/html;
5+
6+
location / {
7+
index index.html index.htm;
8+
}
9+
10+
location ~ \.(css|html)$ {
11+
expires epoch;
12+
}
13+
14+
location ~ \.(eot|otf|ttf|woff|woff2)$ {
15+
if ($request_method = 'OPTIONS') {
16+
add_header 'Access-Control-Allow-Origin' '*';
17+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
18+
#
19+
# Custom headers and headers various browsers *should* be OK with but aren't
20+
#
21+
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
22+
#
23+
# Tell client that this pre-flight info is valid for 20 days
24+
#
25+
add_header 'Access-Control-Max-Age' 1728000;
26+
add_header 'Content-Type' 'text/plain; charset=utf-8';
27+
add_header 'Content-Length' 0;
28+
return 204;
29+
}
30+
if ($request_method = 'POST') {
31+
add_header 'Access-Control-Allow-Origin' '*';
32+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
33+
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
34+
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
35+
}
36+
if ($request_method = 'GET') {
37+
add_header 'Access-Control-Allow-Origin' '*';
38+
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS';
39+
add_header 'Access-Control-Allow-Headers' 'DNT,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range';
40+
add_header 'Access-Control-Expose-Headers' 'Content-Length,Content-Range';
41+
}
42+
}
43+
44+
error_page 500 502 503 504 /50x.html;
45+
location = /50x.html {
46+
root /usr/share/nginx/html;
47+
}
48+
49+
location /healthcheck {
50+
default_type 'text/plain';
51+
return 200 'OK';
52+
}
53+
}

0 commit comments

Comments
 (0)