Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
54 changes: 54 additions & 0 deletions .github/workflows/itkdev_docker_build_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
on:
push:
branches:
- 'develop'

# This Action builds to itkdev/* using ./infrastructure/itkdev/*
name: ITK Dev - Build docker image (develop)

jobs:
docker:
runs-on: ubuntu-latest
env:
VERSION: alpha
APP_VERSION: develop

steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: itkdev/os2display-display-client

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

- name: Set release timestamp
run: |
echo "APP_RELEASE_TIMESTAMP=$(echo $(date +%s))" >> $GITHUB_ENV
echo "APP_RELEASE_TIME=$(echo $(date))" >> $GITHUB_ENV

- name: Build and push (API)
uses: docker/build-push-action@v4
with:
context: ./infrastructure/itkdev/
file: ./infrastructure/itkdev/Dockerfile
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
APP_RELEASE_VERSION=${{ env.APP_VERSION }}
APP_RELEASE_TIMESTAMP=${{ env.APP_RELEASE_TIMESTAMP }}
APP_RELEASE_TIME=${{ env.APP_RELEASE_TIME }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

50 changes: 50 additions & 0 deletions .github/workflows/itkdev_docker_build_tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
---
on:
push:
tags:
- '*'

# This Action builds to itkdev/* using ./infrastructure/itkdev/*
name: ITK Dev - Build docker image (tag)

jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: itkdev/os2display-display-client

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

- name: Set release timestamp
run: |
echo "APP_RELEASE_TIMESTAMP=$(echo $(date +%s))" >> $GITHUB_ENV
echo "APP_RELEASE_TIME=$(echo $(date))" >> $GITHUB_ENV

- name: Build and push (API)
uses: docker/build-push-action@v4
with:
context: ./infrastructure/itkdev/
file: ./infrastructure/itkdev/Dockerfile
build-args: |
APP_VERSION=${{ github.ref }}
APP_RELEASE_VERSION=$GITHUB_REF_NAME
APP_RELEASE_TIMESTAMP=${{ env.APP_RELEASE_TIMESTAMP }}
APP_RELEASE_TIME=${{ env.APP_RELEASE_TIME }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ on:
push:
branches:
- 'develop'
name: Build docker image (develop)

# This Action builds to os2display/* using ./infrastructure/os2display/*
name: OS2display - Build docker image (develop)

jobs:
docker:
Expand Down Expand Up @@ -39,8 +41,8 @@ jobs:
- name: Build and push (API)
uses: docker/build-push-action@v4
with:
context: ./infrastructure/
file: ./infrastructure/Dockerfile
context: ./infrastructure/os2display/
file: ./infrastructure/os2display/Dockerfile
build-args: |
APP_VERSION=${{ env.APP_VERSION }}
APP_RELEASE_VERSION=${{ env.APP_VERSION }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ on:
push:
tags:
- '*'
name: Build docker image (tag)

# This Action builds to os2display/* using ./infrastructure/os2display/*
name: OS2display - Build docker image (tag)

jobs:
docker:
Expand Down Expand Up @@ -35,8 +37,8 @@ jobs:
- name: Build and push (API)
uses: docker/build-push-action@v4
with:
context: ./infrastructure/
file: ./infrastructure/Dockerfile
context: ./infrastructure/os2display/
file: ./infrastructure/os2display/Dockerfile
build-args: |
APP_VERSION=${{ github.ref }}
APP_RELEASE_VERSION=$GITHUB_REF_NAME
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ All notable changes to this project will be documented in this file.
Only slides with a loaded template should be rendered.
- [#109](https://github.com/os2display/display-client/pull/109)
Change docker image name from `os2display/os2display-client` to `os2display/display-client` to match image name and repository name
- Setup separate image builds for itkdev and os2display

## [1.2.6] - 2023-06-12

Expand Down
19 changes: 0 additions & 19 deletions infrastructure/etc/confd/templates/config.tmpl

This file was deleted.

34 changes: 0 additions & 34 deletions infrastructure/etc/confd/templates/default.conf.tmpl

This file was deleted.

45 changes: 0 additions & 45 deletions infrastructure/etc/confd/templates/nginx.conf.tmpl

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ USER root
COPY --from=APP_BUILDER /app/build ${APP_PATH}

# Copy configuration.
COPY etc/ /etc/
COPY etc /etc/

# Create release file
RUN echo "{\"releaseTimestamp\": $APP_RELEASE_TIMESTAMP, \"releaseTime\": \"$APP_RELEASE_TIME\", \"releaseVersion\": \"$APP_RELEASE_VERSION\"}" > ${APP_PATH}/release.json
Expand Down
3 changes: 3 additions & 0 deletions infrastructure/itkdev/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ITK-development image build

This folder contains the infrastructure files for building the `itkdev/os2display-display-client` image.
12 changes: 12 additions & 0 deletions infrastructure/itkdev/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

set -eux

APP_RELEASE_TIMESTAMP=$(date +%s)
APP_RELEASE_TIME=$(date)
APP_VERSION=develop
VERSION=alpha

docker build --pull --no-cache --build-arg APP_VERSION=${APP_VERSION} --build-arg APP_RELEASE_TIMESTAMP="${APP_RELEASE_TIMESTAMP}" --build-arg APP_RELEASE_TIME="${APP_RELEASE_TIME}" --tag=itkdev/os2display-client:${VERSION} --file="Dockerfile" .

# docker push itkdev/os2display-client:${VERSION}
62 changes: 62 additions & 0 deletions infrastructure/os2display/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
FROM node:16 AS APP_BUILDER
LABEL maintainer="ITK Dev <itkdev@mkb.aarhus.dk>"

ARG APP_VERSION="develop"
ARG APP_RELEASE_VERSION="develop"
ARG APP_RELEASE_TIMESTAMP=0
ENV APP_PATH=/app

ADD https://github.com/os2display/display-client/archive/${APP_VERSION}.tar.gz /tmp/app.tar
RUN mkdir -p ${APP_PATH} \
&& tar -zxf /tmp/app.tar --strip-components=1 -C ${APP_PATH} \
&& rm /tmp/app.tar

WORKDIR ${APP_PATH}

# Build it.
RUN yarn install \
&& yarn build

# Remove fixtures
RUN rm -rf public/fixtures

####
## Build main application image.
####
FROM nginxinc/nginx-unprivileged:alpine
LABEL maintainer="ITK Dev <itkdev@mkb.aarhus.dk>"

ARG APP_VERSION="develop"
ARG APP_RELEASE_VERSION="develop"
ARG APP_RELEASE_TIMESTAMP=0
ARG APP_RELEASE_TIME=0
ENV APP_PATH=/var/www/html

USER root

# Install the application.
COPY --from=APP_BUILDER /app/build ${APP_PATH}

# Copy configuration.
COPY etc /etc/

# Create release file
RUN echo "{\"releaseTimestamp\": $APP_RELEASE_TIMESTAMP, \"releaseTime\": \"$APP_RELEASE_TIME\", \"releaseVersion\": \"$APP_RELEASE_VERSION\"}" > ${APP_PATH}/release.json

# Install configuration template handler
ADD https://github.com/kelseyhightower/confd/releases/download/v0.16.0/confd-0.16.0-linux-amd64 /usr/local/bin/confd
RUN chmod +x /usr/local/bin/confd


COPY docker-entrypoint.sh /
RUN chmod +x /docker-entrypoint.sh \
&& chown -R $UID:0 ${APP_PATH} \
&& chmod -R g+w ${APP_PATH}

USER $UID

WORKDIR ${APP_PATH}

EXPOSE 8080

CMD [ "/docker-entrypoint.sh", "nginx", "-g daemon off;" ]
3 changes: 3 additions & 0 deletions infrastructure/os2display/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# OS2display image build

This folder contains the infrastructure files for building the `os2display/display-client` image.
Loading