Skip to content

Commit

Permalink
chore: update docker config and github action
Browse files Browse the repository at this point in the history
  • Loading branch information
cooderl committed Feb 28, 2024
1 parent 6b9e088 commit 62fe6c0
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 12 deletions.
18 changes: 12 additions & 6 deletions .github/workflows/docker-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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" \
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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" \
Expand All @@ -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
Expand All @@ -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
5 changes: 2 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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" ]



Expand All @@ -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" ]
7 changes: 4 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down

0 comments on commit 62fe6c0

Please sign in to comment.