diff --git a/.github/workflows/docker-release.yml b/.github/workflows/docker-release.yml index b95b8b5..5be5d28 100644 --- a/.github/workflows/docker-release.yml +++ b/.github/workflows/docker-release.yml @@ -14,7 +14,7 @@ concurrency: jobs: build-web-images: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -54,7 +54,6 @@ jobs: DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} run: | docker buildx build \ - --build-arg name=app \ --platform linux/amd64,linux/arm64 \ --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/wewe-rss-web" \ --label "org.opencontainers.image.description=wewe-rss web image" \ @@ -68,7 +67,7 @@ jobs: push-web-images-to-docker-hub: needs: build-web-images - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.repository == 'cooderl/wewe-rss' steps: - name: Checkout code @@ -89,11 +88,15 @@ jobs: run: docker pull ghcr.io/${{ github.repository_owner }}/wewe-rss-web:${{env.IMAGE_TAG}} - name: Tag image with Docker Hub repository name and version tag run: docker tag ghcr.io/${{ github.repository_owner }}/wewe-rss-web:${{env.IMAGE_TAG}} ${{ github.repository_owner }}/wewe-rss-web:${{env.IMAGE_TAG}} + - name: Tag image with Docker Hub repository name and version tag + run: docker tag ghcr.io/${{ github.repository_owner }}/wewe-rss-web:${{env.IMAGE_TAG}} ${{ github.repository_owner }}/wewe-rss-web:latest - name: Push image to Docker Hub run: docker push ${{ github.repository_owner }}/wewe-rss-web:${{env.IMAGE_TAG}} + - name: Push image to Docker Hub + run: docker push ${{ github.repository_owner }}/wewe-rss-web:latest build-server-images: - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest steps: - name: Checkout uses: actions/checkout@v3 @@ -133,7 +136,6 @@ jobs: DOCKER_REPO_TAGGED: ${{ env.DOCKER_REPO_TAGGED }} run: | docker buildx build \ - --build-arg name=app \ --platform linux/amd64,linux/arm64 \ --label "org.opencontainers.image.source=https://github.com/${{ github.repository_owner }}/wewe-rss-server" \ --label "org.opencontainers.image.description=wewe-rss server image" \ @@ -147,7 +149,7 @@ jobs: push-server-images-to-docker-hub: needs: build-server-images - runs-on: ubuntu-20.04 + runs-on: ubuntu-latest if: github.repository == 'cooderl/wewe-rss' steps: - name: Checkout code @@ -168,5 +170,9 @@ jobs: run: docker pull ghcr.io/${{ github.repository_owner }}/wewe-rss-server:${{env.IMAGE_TAG}} - name: Tag image with Docker Hub repository name and version tag run: docker tag ghcr.io/${{ github.repository_owner }}/wewe-rss-server:${{env.IMAGE_TAG}} ${{ github.repository_owner }}/wewe-rss-server:${{env.IMAGE_TAG}} + - name: Tag image with Docker Hub repository name and version tag + run: docker tag ghcr.io/${{ github.repository_owner }}/wewe-rss-server:${{env.IMAGE_TAG}} ${{ github.repository_owner }}/wewe-rss-server:latest - name: Push image to Docker Hub run: docker push ${{ github.repository_owner }}/wewe-rss-server:${{env.IMAGE_TAG}} + - name: Push image to Docker Hub + run: docker push ${{ github.repository_owner }}/wewe-rss-server:latest diff --git a/Dockerfile b/Dockerfile index a1c496f..373aa52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,8 +31,7 @@ ENV NODE_ENV=production ENV NEXT_PUBLIC_SERVER_ORIGIN_URL="http://localhost:4000" ENV NEXT_PUBLIC_ENV=prod -CMD [ "npm", "run", "start" ] - +ENTRYPOINT ["sh","-c", "npm run start" ] @@ -50,4 +49,4 @@ ENV MAX_REQUEST_PER_MINUTE=60 ENV AUTH_CODE="" ENV DATABASE_URL="" -CMD [ "npm", "run", "start:migrate:prod" ] +ENTRYPOINT ["sh","-c", "npm run start:migrate:prod" ] diff --git a/docker-compose.yml b/docker-compose.yml index a76d1a8..9e5115f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,17 +5,18 @@ services: image: mysql:latest command: --default-authentication-plugin=mysql_native_password environment: + # 请修改为自己的密码 MYSQL_ROOT_PASSWORD: 123456 TZ: 'Asia/Shanghai' ports: - 3306:3306 server: - image: cooderl/wewe-rss-server + image: cooderl/wewe-rss-server:latest ports: - 4000:4000 depends_on: - - mysql + - db environment: # 数据库连接地址 - DATABASE_URL="mysql://root:123456@db:3306/wewe-rss" @@ -27,7 +28,7 @@ services: - SERVER_ORIGIN_URL=http://localhost:4000 web: - image: cooderl/wewe-rss-web + image: cooderl/wewe-rss-web:latest ports: - 3000:3000 environment: