-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
2,221 additions
and
7 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,48 @@ | ||
name: Build sns-process-image | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-image: | ||
runs-on: ubuntu-latest | ||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: web3bio/sns-process | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v3 | ||
- name: Log in to GitHub Container Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Setup Docker BuildX | ||
uses: docker/setup-buildx-action@v2 | ||
- name: Cache Docker layers | ||
uses: actions/cache@v3 | ||
with: | ||
path: /tmp/.buildx-cache | ||
key: ${{ runner.os }}-docker-build-${{ hashFiles('**/requirements.txt') }} | ||
- name: Extract metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
- name: Build and push | ||
uses: docker/build-push-action@v3 | ||
with: | ||
context: "./sns_process" | ||
file: "./sns_process/Dockerfile" | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=local,src=/tmp/.buildx-cache | ||
cache-to: type=local,dest=/tmp/.buildx-cache-new,mode=max | ||
- name: Clean up post-build cache | ||
run: | | ||
rm -rf /tmp/.buildx-cache | ||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache |
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
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,5 @@ | ||
/.dockerignore | ||
/Dockerfile | ||
/node_modules | ||
/package-lock.json | ||
/.env |
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,20 @@ | ||
# hhttps://hub.docker.com/_/node | ||
FROM node:22 | ||
|
||
LABEL maintainer="Zella Zhong <[email protected]>" | ||
|
||
RUN apt-get update -y && \ | ||
apt-get upgrade -y --force-yes && \ | ||
apt-get install -y --force-yes supervisor | ||
|
||
WORKDIR /node_app | ||
|
||
COPY package*.json ./ | ||
|
||
RUN npm install -g npm@10 | ||
|
||
RUN npm install --only=production | ||
|
||
COPY . . | ||
|
||
ENTRYPOINT ["./run.sh"] |
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,8 @@ | ||
services: | ||
server: | ||
image: ghcr.io/web3bio/data_process:main | ||
container_name: data_process | ||
volumes: | ||
- ~/sns_process:/node_app/data | ||
- ~/sns_process/.env:/node_app/.env | ||
- ~/sns_process/log:/tmp |
Oops, something went wrong.