Skip to content

Commit

Permalink
add docker image
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 10, 2024
1 parent dd78859 commit 7015e37
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 0 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/multiarchdocker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2022-2024 Ronan LE MEILLAT
# This program is licensed under the AGPLv3 license.
name: Docker Build and Push

on:
release:
types: [ published ]

jobs:
build-and-push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ secrets.DOCKER_IMAGE }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
file: Dockerfile
context: .
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# (c) 2024 Ronan LE MEILLAT for SCTG Development
# This file is licensed under the AGPLv3 License
# See the LICENSE file for more information

FROM node:20 AS builder
COPY . /app
WORKDIR /app
RUN npm ci
RUN npm run build

FROM nginx:alpine
COPY --from=builder /app/dist /usr/share/nginx/html
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

0 comments on commit 7015e37

Please sign in to comment.