mirror of
https://github.com/BreizhHardware/Jellystat.git
synced 2026-01-18 16:27:20 +01:00
Merge pull request #78 from lucas-dclrcq/mult-arch-docker
Build & Push multi-arch docker image
This commit is contained in:
30
.github/workflows/docker-image-arm.yml
vendored
30
.github/workflows/docker-image-arm.yml
vendored
@@ -1,30 +0,0 @@
|
||||
name: Docker CI Unstable ARM
|
||||
on:
|
||||
push:
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches: [main]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v1
|
||||
- name: Set up Docker Buildx
|
||||
uses: docker/setup-buildx-action@v1
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.1.0
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_TOKEN }}
|
||||
- name: Build and push Docker image for ARM
|
||||
uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
file: ./Dockerfile-arm
|
||||
push: true
|
||||
tags: cyfershepard/jellystat:arm
|
||||
platforms: linux/arm/v7
|
||||
6
.github/workflows/docker-image.yml
vendored
6
.github/workflows/docker-image.yml
vendored
@@ -11,6 +11,11 @@ jobs:
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v2
|
||||
- name: Set up Docker Buildx
|
||||
id: buildx
|
||||
uses: docker/setup-buildx-action@v3
|
||||
- name: Set up QEMU
|
||||
uses: docker/setup-qemu-action@v3
|
||||
- name: Login to Docker Hub
|
||||
uses: docker/login-action@v2.1.0
|
||||
with:
|
||||
@@ -21,4 +26,5 @@ jobs:
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||
tags: cyfershepard/jellystat:latest
|
||||
|
||||
13
Dockerfile
13
Dockerfile
@@ -1,14 +1,21 @@
|
||||
FROM node:slim
|
||||
# Stage 1: Build the application
|
||||
FROM node:slim AS builder
|
||||
|
||||
RUN mkdir /app
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm cache clean --force
|
||||
RUN npm install
|
||||
|
||||
COPY ./ ./
|
||||
|
||||
# Stage 2: Create the production image
|
||||
FROM node:slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "start-app"]
|
||||
|
||||
|
||||
@@ -1,21 +0,0 @@
|
||||
# Stage 1: Build the application
|
||||
FROM arm32v7/node:14 AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm cache clean --force
|
||||
RUN npm install
|
||||
|
||||
COPY ./ ./
|
||||
|
||||
# Stage 2: Create the production image
|
||||
FROM arm32v7/node:14-slim
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=builder /app .
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "start-app"]
|
||||
Reference in New Issue
Block a user