mirror of
https://github.com/Lissy93/dashy.git
synced 2025-07-25 22:55:32 +02:00
🔀 Merge pull request #457 from Lissy93/ARCH/docker-multi-arch
[ARCH] Multi-architecture Docker image
This commit is contained in:
commit
31702a62c3
@ -80,17 +80,17 @@ jobs:
|
|||||||
uses: docker/build-push-action@v2
|
uses: docker/build-push-action@v2
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile-multi-arch
|
file: ./Dockerfile
|
||||||
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
platforms: linux/amd64,linux/arm64,linux/arm/v7
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
push: true
|
push: true
|
||||||
|
|
||||||
- name: 💬 Set Docker Hub Description
|
# - name: 💬 Set Docker Hub Description
|
||||||
uses: peter-evans/dockerhub-description@v2
|
# uses: peter-evans/dockerhub-description@v2
|
||||||
with:
|
# with:
|
||||||
repository: lissy93/dashy
|
# repository: lissy93/dashy
|
||||||
readme-filepath: ./README.md
|
# readme-filepath: ./README.md
|
||||||
short-description: Dashy - A self-hosted start page for your server
|
# short-description: Dashy - A self-hosted start page for your server
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
# username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
# password: ${{ secrets.DOCKER_PASSWORD }}
|
40
.github/workflows/docker-release.yml
vendored
40
.github/workflows/docker-release.yml
vendored
@ -1,40 +0,0 @@
|
|||||||
# Test and build the Docker container after a release
|
|
||||||
# Then push it to GH container registry if all checks pass
|
|
||||||
name: Build & Publish Docker Image
|
|
||||||
on:
|
|
||||||
release:
|
|
||||||
types: [published]
|
|
||||||
env:
|
|
||||||
REGISTRY: ghcr.io
|
|
||||||
IMAGE_NAME: ${{ github.repository }}
|
|
||||||
jobs:
|
|
||||||
build-and-push-image:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: read
|
|
||||||
packages: write
|
|
||||||
steps:
|
|
||||||
# Get the code
|
|
||||||
- name: Checkout repository 🛎️
|
|
||||||
uses: actions/checkout@v2
|
|
||||||
# Log into ghcr.io
|
|
||||||
- name: Log in to the Container registry 🔑
|
|
||||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
|
||||||
with:
|
|
||||||
registry: ${{ env.REGISTRY }}
|
|
||||||
username: ${{ github.actor }}
|
|
||||||
password: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
# Get release version, for Docker tag
|
|
||||||
- name: Extract metadata (tags, labels) for Docker 🗂️
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
|
||||||
with:
|
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
|
||||||
# Build the container, and push if successful
|
|
||||||
- name: Build and push Docker image ⚒️
|
|
||||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
tags: ${{ steps.meta.outputs.tags }}
|
|
||||||
labels: ${{ steps.meta.outputs.labels }}
|
|
48
Dockerfile
48
Dockerfile
@ -1,4 +1,30 @@
|
|||||||
FROM node:lts-alpine3.14
|
FROM node:14.17.5-alpine AS BUILD_IMAGE
|
||||||
|
|
||||||
|
ARG TARGETPLATFORM
|
||||||
|
ENV TARGETPLATFORM=${TARGETPLATFORM:-linux/amd64}
|
||||||
|
|
||||||
|
# Install additional tools needed on arm64 and armv7
|
||||||
|
RUN \
|
||||||
|
case "${TARGETPLATFORM}" in \
|
||||||
|
'linux/arm64') apk add --no-cache python make g++ ;; \
|
||||||
|
'linux/arm/v7') apk add --no-cache python make g++ ;; \
|
||||||
|
esac
|
||||||
|
|
||||||
|
# Create and set the working directory
|
||||||
|
WORKDIR /app
|
||||||
|
|
||||||
|
# Install app dependencies
|
||||||
|
COPY package.json yarn.lock ./
|
||||||
|
RUN yarn install --frozen-lockfile --network-timeout 1000000
|
||||||
|
|
||||||
|
# Copy over all project files and folders to the working directory
|
||||||
|
COPY . ./
|
||||||
|
|
||||||
|
# Build initial app for production
|
||||||
|
RUN yarn build
|
||||||
|
|
||||||
|
# Build the final image
|
||||||
|
FROM node:14.17.5-alpine
|
||||||
|
|
||||||
# Define some ENV Vars
|
# Define some ENV Vars
|
||||||
ENV PORT=80 \
|
ENV PORT=80 \
|
||||||
@ -8,24 +34,18 @@ ENV PORT=80 \
|
|||||||
# Create and set the working directory
|
# Create and set the working directory
|
||||||
WORKDIR ${DIRECTORY}
|
WORKDIR ${DIRECTORY}
|
||||||
|
|
||||||
# Copy over both 'package.json' and 'package-lock.json' (if available)
|
# Install tini for initialization and tzdata for setting timezone
|
||||||
COPY package*.json ./
|
RUN apk add --no-cache tzdata tini
|
||||||
COPY yarn.lock ./
|
|
||||||
|
|
||||||
# Install project dependencies
|
# Copy built application from build phase
|
||||||
RUN yarn
|
COPY --from=BUILD_IMAGE /app ./
|
||||||
|
|
||||||
# Copy over all project files and folders to the working directory
|
# Finally, run start command to serve up the built application
|
||||||
COPY . .
|
ENTRYPOINT [ "/sbin/tini", "--" ]
|
||||||
|
CMD [ "yarn", "build-and-start" ]
|
||||||
# Build initial app for production
|
|
||||||
RUN yarn build
|
|
||||||
|
|
||||||
# Expose given port
|
# Expose given port
|
||||||
EXPOSE ${PORT}
|
EXPOSE ${PORT}
|
||||||
|
|
||||||
# Finally, run start command to serve up the built application
|
|
||||||
CMD [ "yarn", "build-and-start"]
|
|
||||||
|
|
||||||
# Run simple healthchecks every 5 mins, to check the Dashy's everythings great
|
# Run simple healthchecks every 5 mins, to check the Dashy's everythings great
|
||||||
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
|
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
|
||||||
|
Loading…
x
Reference in New Issue
Block a user