Merge branch 'main' of github.com:titaniumnetwork-dev/Ultraviolet-Node
This commit is contained in:
commit
5b3b239a26
2 changed files with 59 additions and 4 deletions
45
.github/workflows/docker-image.yml
vendored
Normal file
45
.github/workflows/docker-image.yml
vendored
Normal file
|
|
@ -0,0 +1,45 @@
|
|||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: ["main"]
|
||||
pull_request:
|
||||
branches: ["main"]
|
||||
schedule:
|
||||
- cron: "30 12 * * 0" # Run once every Sunday
|
||||
|
||||
jobs:
|
||||
push_to_registry:
|
||||
name: Push Docker image to Docker Hub
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Docker meta
|
||||
id: meta
|
||||
uses: docker/metadata-action@v4
|
||||
with:
|
||||
images: ${{ secrets.DOCKER_USERNAME }}/ultraviolet-node
|
||||
tags: |
|
||||
type=raw,value={{date 'YYYYMMDD'}}
|
||||
|
||||
- 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: Build & push Docker image
|
||||
uses: docker/build-push-action@v3
|
||||
with:
|
||||
context: .
|
||||
platforms: linux/amd64,linux/arm64
|
||||
push: true
|
||||
tags: ${{ secrets.DOCKER_USERNAME }}/ultraviolet-node:latest,${{ steps.meta.outputs.tags }}
|
||||
18
Dockerfile
18
Dockerfile
|
|
@ -1,9 +1,19 @@
|
|||
FROM node:current-slim
|
||||
# build app
|
||||
FROM docker.io/node AS builder
|
||||
|
||||
RUN apt update
|
||||
RUN apt install git
|
||||
|
||||
COPY . /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./package.json ./package-lock.json ./src/ ./
|
||||
RUN npm install
|
||||
|
||||
RUN npm install --omit=dev
|
||||
# build final
|
||||
FROM gcr.io/distroless/nodejs:16
|
||||
|
||||
ENTRYPOINT npm start
|
||||
EXPOSE 8080/tcp
|
||||
|
||||
COPY --from=builder /app /
|
||||
|
||||
CMD ["src/index.js"]
|
||||
Loading…
Add table
Reference in a new issue