-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: merge github.com/twikoojs/twikoo-docker
- Loading branch information
Showing
4 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Docker Image CI | ||
|
||
on: | ||
release: | ||
types: [published] | ||
workflow_dispatch: | ||
|
||
jobs: | ||
|
||
build: | ||
|
||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v3 | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
- | ||
name: Login to DockerHub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
- | ||
name: Get twikoo:latest version | ||
run: echo "TWIKOO_LATEST_VERSION=$(npm view twikoo@latest version)" >> "$GITHUB_ENV" | ||
- | ||
name: Build and push amd64 image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/amd64,linux/arm64 | ||
push: true | ||
tags: | | ||
imaegoo/twikoo:latest | ||
imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }} | ||
- | ||
name: Build and push arm32v7 image | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: . | ||
platforms: linux/arm/v7 | ||
push: true | ||
tags: | | ||
imaegoo/twikoo:arm32v7 | ||
imaegoo/twikoo:${{ env.TWIKOO_LATEST_VERSION }}-arm32v7 | ||
build-args: NODE_IMAGE=arm32v7/node |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
ARG NODE_IMAGE=node | ||
FROM ${NODE_IMAGE}:lts AS build | ||
WORKDIR /app | ||
ENV NODE_ENV production | ||
RUN set -eux; \ | ||
npm install --production tkserver@latest; \ | ||
mkdir -p data | ||
FROM ${NODE_IMAGE}:lts-buster-slim | ||
WORKDIR /app | ||
ENV NODE_ENV production | ||
COPY --from=build /app . | ||
EXPOSE 8080 | ||
CMD ["/app/node_modules/.bin/tkserver"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
# https://docs.docker.com/compose/compose-file/compose-file-v3/ | ||
version: '3' | ||
services: | ||
twikoo-service: | ||
image: imaegoo/twikoo | ||
environment: | ||
TWIKOO_THROTTLE: 250 | ||
TZ: Asia/Shanghai | ||
volumes: | ||
- /app/data | ||
ports: | ||
- 8080:8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Links |