Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
jackjieYYY committed Nov 3, 2023
1 parent 8340d66 commit fd8bc64
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
9 changes: 0 additions & 9 deletions .github/workflows/autoDeploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,6 @@ jobs:
- name: Build
run: npm run build

# 下载static-web-server二进制文件
- name: Download static-web-server binary
run: |
curl --proto '=https' --tlsv1.2 -sSfL https://get.static-web-server.net | sh
- name: Prepare files for Docker build
run: |
cp /usr/local/bin/static-web-server .
- name: Log in to Docker Hub
uses: docker/login-action@f4ef78c080cd8ba55a85445d5b36e214a81df20a
with:
Expand Down
6 changes: 1 addition & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# 使用 distroless base 镜像,因为它很小且为了安全没有包含不必要的程序或库
FROM gcr.io/distroless/base-debian12
FROM joseluisq/static-web-server:2-alpine

# 设置工作目录
WORKDIR /app

# 从构建上下文中复制 static-web-server 二进制文件
# 假设在 GitHub Actions workflow 中 static-web-server 被下载到工作目录
COPY static-web-server /usr/local/bin/static-web-server

# 从构建上下文中复制构建好的静态文件
# 假设 npm run build 生成的静态文件在 /dist 目录下
COPY dist/ /app/
Expand Down

0 comments on commit fd8bc64

Please sign in to comment.