Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.

Commit be59c4d

Browse files
committed
first commit
0 parents  commit be59c4d

38 files changed

+3462
-0
lines changed

.dockerignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
logs
2+
dist
3+
doc
4+
node_modules
5+
.vscode
6+
.git
7+
.gitignore
8+
README.md
9+
*.tar.gz

.github/workflows/docker-image.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
release:
5+
types: [created]
6+
workflow_dispatch:
7+
inputs:
8+
tag:
9+
description: 'Tag Name'
10+
required: true
11+
12+
jobs:
13+
build-and-push:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v2
17+
18+
- name: Set up Docker Buildx
19+
uses: docker/setup-buildx-action@v1
20+
21+
- name: Login to Docker Hub
22+
uses: docker/login-action@v1
23+
with:
24+
username: ${{ secrets.DOCKERHUB_USERNAME }}
25+
password: ${{ secrets.DOCKERHUB_PASSWORD }}
26+
27+
- name: Set tag name
28+
id: tag_name
29+
run: |
30+
if [ "${{ github.event_name }}" = "release" ]; then
31+
echo "::set-output name=tag::${GITHUB_REF#refs/tags/}"
32+
elif [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
33+
echo "::set-output name=tag::${{ github.event.inputs.tag }}"
34+
fi
35+
36+
- name: Build and push Docker image with Release tag
37+
uses: docker/build-push-action@v2
38+
with:
39+
context: .
40+
file: ./Dockerfile
41+
push: true
42+
tags: |
43+
vinlic/spark-free-api:${{ steps.tag_name.outputs.tag }}
44+
vinlic/spark-free-api:latest
45+
platforms: linux/amd64,linux/arm64
46+
build-args: TARGETPLATFORM=${{ matrix.platform }}

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
dist/
2+
node_modules/
3+
logs/

Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
FROM node:lts AS BUILD_IMAGE
2+
3+
WORKDIR /app
4+
5+
COPY . /app
6+
7+
RUN npm i --registry http://registry.npmmirror.com && npm run build
8+
9+
FROM node:lts-alpine
10+
11+
COPY --from=BUILD_IMAGE /app/configs ./configs
12+
COPY --from=BUILD_IMAGE /app/package.json ./package.json
13+
COPY --from=BUILD_IMAGE /app/dist ./dist
14+
COPY --from=BUILD_IMAGE /app/node_modules ./node_modules
15+
16+
WORKDIR /app
17+
18+
EXPOSE 8000
19+
20+
CMD ["npm", "start"]

LICENSE

Lines changed: 674 additions & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)