Skip to content

一分钟搭建影视站,支持Docker等部署方式

feat: add Dockerfile and GitHub Actions workflow for Docker image build and push

developer640c856cc108
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..fab17ac
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1 @@
+// Empty file
diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml
new file mode 100644
index 0000000..cc4ae87
--- /dev/null
+++ b/.github/workflows/docker-build.yml
@@ -0,0 +1,30 @@
+name: 打包上传到dockerHub
+
+on:
+ push:
+ branches:
+ - main
+
+jobs:
+ build-and-push:
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout code
+ uses: actions/checkout@v4
+
+ - name: Set up Docker Buildx
+ uses: docker/setup-buildx-action@v3
+
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKER_USERNAME }}
+ password: ${{ secrets.DOCKER_PASSWORD }}
+
+ - name: Build and push Docker image
+ uses: docker/build-push-action@v5
+ with:
+ context: .
+ file: ./Dockerfile
+ push: true
+ tags: ${{ secrets.DOCKER_USERNAME }}/libretv:latest
\ No newline at end of file
diff --git a/Dockerfile b/Dockerfile
new file mode 100644
index 0000000..cf055fe
--- /dev/null
+++ b/Dockerfile
@@ -0,0 +1,4 @@
+FROM nginx:latest
+COPY . /usr/share/nginx/html
+EXPOSE 80
+CMD ["nginx", "-g", "daemon off;"]