Skip to content

Commit

Permalink
feat: improve
Browse files Browse the repository at this point in the history
  • Loading branch information
lcxfs1991 committed Feb 2, 2024
1 parent cf8b634 commit b0325b4
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,17 @@ jobs:
- name: Set Timestamp
run: echo "TIMESTAMP=$(date +%s%3N)" >> $GITHUB_ENV

- name: Fetch default.conf
uses: valitydev/action-download-file@v1
with:
url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/cdn/default.conf
target-path: .
# - name: Fetch default.conf
# uses: valitydev/action-download-file@v1
# with:
# url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/cdn/default.conf
# target-path: .

- name: Fetch Dockerfile
uses: valitydev/action-download-file@v1
with:
url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/cdn/Dockerfile
target-path: .
# - name: Fetch Dockerfile
# uses: valitydev/action-download-file@v1
# with:
# url: https://raw.githubusercontent.com/lcxfs1991/docschina-deployment/main/cdn/Dockerfile
# target-path: .

- name: Docker build
uses: docker/setup-buildx-action@v3
Expand Down
3 changes: 3 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
FROM nginx:1.19.10-alpine
COPY default.conf /etc/nginx/conf.d/default.conf
COPY cdn /usr/share/nginx/html
26 changes: 26 additions & 0 deletions default.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
server {
listen 80;
# listen [::]:80;
server_name localhost;
access_log /usr/share/nginx/access.log;
error_log /usr/share/nginx/error.log;

location ~ .*\.(gif|jpg|jpeg|png|svg)$ {
root /usr/share/nginx/html;
expires 30d;
}

location ~ .*\.(js|css|eot|ttf|woff)$ {
root /usr/share/nginx/html;
expires 30d;
gzip on;
gzip_types text/css application/javascript;
}

location / {
root /usr/share/nginx/html;
index index.html index.htm;
try_files $uri $uri/ /index.html;
expires 60s;
}
}

0 comments on commit b0325b4

Please sign in to comment.