From 36de8c58a13f5c056e4e7bb287e56f519dd37fd0 Mon Sep 17 00:00:00 2001 From: Jon Date: Fri, 11 Aug 2023 00:20:46 +0930 Subject: [PATCH] feat(docker): docker building added !1 --- .gitlab-ci.yml | 5 ++++- dockerfile | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 1 deletion(-) create mode 100644 dockerfile diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index db6b6a5..812717a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -2,7 +2,10 @@ variables: MY_PROJECT_ID: "48321671" GIT_SYNC_URL: "https://$GITHUB_USERNAME_ROBOT:$GITHUB_TOKEN_ROBOT@github.com/NoFussComputing/nodered_ldap_self_service.git" - + DOCKER_IMAGE_BUILD_TARGET_PLATFORMS: "linux/amd64,linux/arm64,linux/arm/v7" + DOCKER_IMAGE_PUBLISH_NAME: 'ldap-selfservice' + DOCKER_IMAGE_PUBLISH_REGISTRY: docker.io/nofusscomputing + DOCKER_IMAGE_PUBLISH_URL: https://hub.docker.com/r/nofusscomputing/$DOCKER_IMAGE_PUBLISH_NAME PAGES_ENVIRONMENT_PATH: projects/ldap_self_service/ include: diff --git a/dockerfile b/dockerfile new file mode 100644 index 0000000..b35bb4b --- /dev/null +++ b/dockerfile @@ -0,0 +1,42 @@ +FROM --platform=$TARGETPLATFORM python:3.11-bullseye as CloneRepo + + +RUN export DEBIAN_FRONTEND=noninteractive \ + && dpkg-reconfigure debconf -f noninteractive + +RUN apt update \ + && apt install -yq \ + git + +RUN git clone --depth=1 -b genesis https://gitlab.com/nofusscomputing/projects/nodered_ldap_self_service.git /tmp/self_service ; ls -l /tmp/self_service + + +FROM --platform=$TARGETPLATFORM nodered/node-red:3.0.2-18 + +LABEL \ + # org.opencontainers.image.authors="{contributor url}" \ + org.opencontainers.image.vendor="No Fuss Computing" \ + # org.opencontainers.image.url="{dockerhub url}" \ + # org.opencontainers.image.documentation="{docs url}" \ + # org.opencontainers.image.source="{repo url}" \ + # org.opencontainers.image.revision="{git commit sha at time of build}" \ + org.opencontainers.image.title="No Fuss Computings LDAP Self Service" \ + org.opencontainers.image.description="A NodeRED App for LDAP Self Service" \ + org.opencontainers.image.vendor="No Fuss Computing" + # org.opencontainers.image.version="{git tag}" + +USER root + +COPY --from=CloneRepo /tmp/self_service/* /data/ + +COPY includes/ / + +RUN chown node-red:node-red -R /data; \ + chown node-red:node-red -R /usr/src/node-red; + +USER node-red + +RUN cd /data; \ + npm install package.json + +VOLUME [ "/data", "/usr/src/node-red" ]