Skip to content

Commit

Permalink
Merge pull request #2 from Accenture/ci/add-docker-build
Browse files Browse the repository at this point in the history
Ci/add docker build
  • Loading branch information
ChristophBe authored Oct 17, 2024
2 parents 63ada88 + 243efb0 commit 272e23b
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 2 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/build-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Create and publish a Docker image

on:
push:
branches: ['main']

env:
REGISTRY: ghcr.io
IMAGE_NAME: accenture/federated-catalogue-viewer

jobs:
build-and-push-image:
runs-on: ubuntu-latest

permissions:
contents: read
packages: write

steps:
- name: Checkout repository
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: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
context: .
push: true
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18 as build-deps
FROM --platform=$BUILDPLATFORM node:18 AS build-deps

WORKDIR /usr/src/app
COPY package.json package-lock.json ./
Expand Down
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ User interface to interact with the [XFSC Federated Catalogue](https://gitlab.ec
## Running the app

1. Run `cp example.env .env` and adjust the variables to connect to your catalog instance.
2. Run `docker compose up` to start the app. The UI will be available at `http://localhost:4200/`.
2. Run `docker compose up` to start the app using a prebuild Docker image. `docker compose up --build` will build and run the application.
3. The UI will be available at `http://localhost:4200/`.

Make sure to add a read-only user to your catalog configuration first. If `DEMO_USERNAME` and `DEMO_USERNAME` are set in your environment, the catalog frontend will automatically authenticate itself. Be aware that this is a frontend component only -- if set, the credentials will be accessible in the browser.

Expand Down
1 change: 1 addition & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ services:
frontend:
build:
context: .
image: ghcr.io/accenture/federated-catalogue-viewer:latest
ports:
- '4200:8080'
env_file: .env

0 comments on commit 272e23b

Please sign in to comment.