Skip to content

Commit

Permalink
ci: merge github.com/twikoojs/twikoo-docker
Browse files Browse the repository at this point in the history
  • Loading branch information
imaegoo committed Sep 4, 2023
1 parent 39ccd22 commit 5422aa4
Show file tree
Hide file tree
Showing 4 changed files with 79 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/docker-image.yml
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
13 changes: 13 additions & 0 deletions Dockerfile
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"]
12 changes: 12 additions & 0 deletions docker-compose.yml
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
1 change: 1 addition & 0 deletions docs/en/link.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Links

0 comments on commit 5422aa4

Please sign in to comment.