From e47ea687f9797c9f5cfe48c31e2d3e72fc571166 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 29 Aug 2024 16:03:58 +0200 Subject: [PATCH 1/4] Fix maintenance dockerfiles image name --- webapp/Dockerfile.maintenance | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/webapp/Dockerfile.maintenance b/webapp/Dockerfile.maintenance index 956c1d1b1..d6cd034e8 100644 --- a/webapp/Dockerfile.maintenance +++ b/webapp/Dockerfile.maintenance @@ -1,7 +1,7 @@ ################################################################################## # BASE ########################################################################### ################################################################################## -FROM 20.12.1-alpine3.19 as base +FROM node:20.12.1-alpine3.19 AS base # ENVs ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame From 77219363e92eea535559bb3e96fbec526998c4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 29 Aug 2024 16:09:25 +0200 Subject: [PATCH 2/4] Add 'maintenance' to scopes of '.github/workflows/test.lint_pr.yml' --- .github/workflows/test.lint_pr.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test.lint_pr.yml b/.github/workflows/test.lint_pr.yml index 8832ba992..d80ec7b5a 100644 --- a/.github/workflows/test.lint_pr.yml +++ b/.github/workflows/test.lint_pr.yml @@ -31,6 +31,7 @@ jobs: backend webapp frontend + maintenance database docu docker From 1a2c7abfe8c2d9e3ee68a604d038a9d2ad039437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 29 Aug 2024 16:19:19 +0200 Subject: [PATCH 3/4] Fix warning because of lower case 'as' instead of uppercase 'AS' in dockerfiles --- backend/Dockerfile | 12 ++++++------ deployment/src/docker/backend.Dockerfile | 6 +++--- deployment/src/docker/maintenance.Dockerfile | 8 ++++---- deployment/src/docker/webapp.Dockerfile | 6 +++--- frontend/Dockerfile | 14 +++++++------- neo4j/Dockerfile | 4 ++-- webapp/Dockerfile | 12 ++++++------ webapp/Dockerfile.maintenance | 6 +++--- 8 files changed, 34 insertions(+), 34 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 4508ada30..a7931f31a 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE (Is pushed to DockerHub for rebranding) ################################### ################################################################################## -FROM node:20.12.1-alpine3.19 as base +FROM node:20.12.1-alpine3.19 AS base # ENVs ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame @@ -48,7 +48,7 @@ WORKDIR ${DOCKER_WORKDIR} ################################################################################## # DEVELOPMENT (Connected to the local environment, to reload on demand) ########## ################################################################################## -FROM base as development +FROM base AS development # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -61,7 +61,7 @@ CMD /bin/sh -c "yarn install && yarn run dev" ################################################################################## # CODE (Does contain all code files and is pushed to DockerHub for rebranding) ### ################################################################################## -FROM base as code +FROM base AS code # copy everything, but do not build. COPY . . @@ -69,7 +69,7 @@ COPY . . ################################################################################## # BUILD (Does contain all files and the compilate and is therefore bloated) ###### ################################################################################## -FROM code as build +FROM code AS build # yarn install RUN yarn install --production=false --frozen-lockfile --non-interactive @@ -79,7 +79,7 @@ RUN /bin/sh -c "yarn run build" ################################################################################## # TEST ########################################################################### ################################################################################## -FROM build as test +FROM build AS test # Run command CMD /bin/sh -c "yarn run dev" @@ -87,7 +87,7 @@ CMD /bin/sh -c "yarn run dev" ################################################################################## # PRODUCTION (Does contain only "binary"- and static-files to reduce image size) # ################################################################################## -FROM base as production +FROM base AS production # Copy "binary"-files from build image COPY --from=build ${DOCKER_WORKDIR}/build ./build diff --git a/deployment/src/docker/backend.Dockerfile b/deployment/src/docker/backend.Dockerfile index a0b6e4ed4..76a091da2 100644 --- a/deployment/src/docker/backend.Dockerfile +++ b/deployment/src/docker/backend.Dockerfile @@ -7,7 +7,7 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## # CODE (branded) ################################################################# ################################################################################## -FROM $APP_IMAGE_CODE as code +FROM $APP_IMAGE_CODE AS code ARG CONFIGURATION=example @@ -20,7 +20,7 @@ COPY configurations/${CONFIGURATION}/branding/email/ src/middleware/helpers/emai ################################################################################## # BUILD ########################################################################## ################################################################################## -FROM code as build +FROM code AS build # yarn install RUN yarn install --production=false --frozen-lockfile --non-interactive @@ -30,7 +30,7 @@ RUN yarn run build ################################################################################## # BRANDED (Does contain only "binary"- and static-files to reduce image size) #### ################################################################################## -FROM $APP_IMAGE_BASE as branded +FROM $APP_IMAGE_BASE AS branded # TODO - do all copying with one COPY command to have one layer # Copy "binary"-files from build image diff --git a/deployment/src/docker/maintenance.Dockerfile b/deployment/src/docker/maintenance.Dockerfile index 95501252c..8eefcc067 100644 --- a/deployment/src/docker/maintenance.Dockerfile +++ b/deployment/src/docker/maintenance.Dockerfile @@ -7,7 +7,7 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## # CODE (branded) ################################################################# ################################################################################## -FROM $APP_IMAGE_CODE as code +FROM $APP_IMAGE_CODE AS code ARG CONFIGURATION=example @@ -25,7 +25,7 @@ RUN tools/merge-locales.sh ################################################################################## # BUILD ########################################################################## ################################################################################## -FROM code as build +FROM code AS build # yarn install ## unnicely done in $APP_IMAGE_CODE at the moment, see main repo @@ -36,8 +36,8 @@ RUN yarn run generate ################################################################################## # BRANDED ### TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO #### ################################################################################## -# FROM $APP_IMAGE_BASE as branded -FROM nginx:alpine as branded +# FROM $APP_IMAGE_BASE AS branded +FROM nginx:alpine AS branded COPY --from=build ./app/dist/ /usr/share/nginx/html/ RUN rm /etc/nginx/conf.d/default.conf diff --git a/deployment/src/docker/webapp.Dockerfile b/deployment/src/docker/webapp.Dockerfile index d811219c3..54f79a56f 100644 --- a/deployment/src/docker/webapp.Dockerfile +++ b/deployment/src/docker/webapp.Dockerfile @@ -7,7 +7,7 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} ################################################################################## # CODE (branded) ################################################################# ################################################################################## -FROM $APP_IMAGE_CODE as code +FROM $APP_IMAGE_CODE AS code ARG CONFIGURATION=example @@ -28,7 +28,7 @@ RUN tools/merge-locales.sh ################################################################################## # BUILD ########################################################################## ################################################################################## -FROM code as build +FROM code AS build # yarn install RUN yarn install --production=false --frozen-lockfile --non-interactive @@ -38,7 +38,7 @@ RUN yarn run build ################################################################################## # BRANDED (Does contain only "binary"- and static-files to reduce image size) #### ################################################################################## -FROM $APP_IMAGE_BASE as branded +FROM $APP_IMAGE_BASE AS branded # TODO - do all copying with one COPY command to have one layer # Copy "binary"-files from build image diff --git a/frontend/Dockerfile b/frontend/Dockerfile index c7bbba687..370dfa606 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -1,4 +1,4 @@ -FROM node:21-alpine3.17 as base +FROM node:21-alpine3.17 AS base # ENVs (available in production aswell, can be overwritten by commandline or env file) ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame @@ -43,7 +43,7 @@ WORKDIR ${DOCKER_WORKDIR} ################################################################################## # DEVELOPMENT (Connected to the local environment, to reload on demand) ########## ################################################################################## -FROM base as development +FROM base AS development # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -56,7 +56,7 @@ CMD /bin/sh -c "npm install && npm run dev" ################################################################################## # STORYBOOK ###################################################################### ################################################################################## -FROM base as storybook +FROM base AS storybook # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -69,7 +69,7 @@ CMD /bin/sh -c "npm install && npm run storybook" ################################################################################## # DOCUMENTATION ################################################################## ################################################################################## -FROM base as documentation +FROM base AS documentation # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -82,7 +82,7 @@ CMD /bin/sh -c "npm install && npm run docs:dev" ################################################################################## # BUILD (Does contain all files and is therefore bloated) ######################## ################################################################################## -FROM base as build +FROM base AS build # Copy everything COPY . . @@ -94,7 +94,7 @@ RUN npm run build ################################################################################## # TEST ########################################################################### ################################################################################## -#FROM build as test +#FROM build AS test # Install Additional Software # RUN apk add --no-cache bash jq @@ -105,7 +105,7 @@ RUN npm run build ################################################################################## # PRODUCTION (Does contain only "binary"- and static-files to reduce image size) # ################################################################################## -FROM base as production +FROM base AS production # Copy "binary"-files from build image COPY --from=build ${DOCKER_WORKDIR}/build ./build diff --git a/neo4j/Dockerfile b/neo4j/Dockerfile index 89c45ff66..b1d07080e 100644 --- a/neo4j/Dockerfile +++ b/neo4j/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # COMMUNITY ###################################################################### ################################################################################## -FROM amd64/neo4j:4.4-community as community +FROM amd64/neo4j:4.4-community AS community # ENVs ## We Cannot do `$(date -u +'%Y-%m-%dT%H:%M:%SZ')` here so we use unix timestamp=0 @@ -36,7 +36,7 @@ RUN wget https://github.com/neo4j-contrib/neo4j-apoc-procedures/releases/downloa ################################################################################## # ENTERPRISE ##################################################################### ################################################################################## -FROM neo4j:4.4-enterprise as enterprise +FROM neo4j:4.4-enterprise AS enterprise # Install Additional Software ## install: wget, htop (TODO: why do we need htop?) diff --git a/webapp/Dockerfile b/webapp/Dockerfile index c6f58652f..f610713fc 100644 --- a/webapp/Dockerfile +++ b/webapp/Dockerfile @@ -1,7 +1,7 @@ ################################################################################## # BASE (Is pushed to DockerHub for rebranding) ################################### ################################################################################## -FROM node:20.12.1-alpine3.19 as base +FROM node:20.12.1-alpine3.19 AS base # ENVs ## DOCKER_WORKDIR would be a classical ARG, but that is not multi layer persistent - shame @@ -48,7 +48,7 @@ WORKDIR ${DOCKER_WORKDIR} ################################################################################## # DEVELOPMENT (Connected to the local environment, to reload on demand) ########## ################################################################################## -FROM base as development +FROM base AS development # We don't need to copy or build anything since we gonna bind to the # local filesystem which will need a rebuild anyway @@ -61,7 +61,7 @@ CMD /bin/sh -c "yarn install && yarn run dev" ################################################################################## # CODE (Does contain all code files and is pushed to DockerHub for rebranding) ### ################################################################################## -FROM base as code +FROM base AS code # copy everything, but do not build. COPY . . @@ -69,7 +69,7 @@ COPY . . ################################################################################## # BUILD (Does contain all files and the compilate and is therefore bloated) ###### ################################################################################## -FROM code as build +FROM code AS build # yarn install RUN yarn install --production=false --frozen-lockfile --non-interactive @@ -79,7 +79,7 @@ RUN yarn run build ################################################################################## # TEST ########################################################################### ################################################################################## -FROM build as test +FROM build AS test # Run command CMD /bin/sh -c "yarn run dev" @@ -87,7 +87,7 @@ CMD /bin/sh -c "yarn run dev" ################################################################################## # PRODUCTION (Does contain only "binary"- and static-files to reduce image size) # ################################################################################## -FROM base as production +FROM base AS production # TODO - do all copying with one COPY command to have one layer # Copy "binary"-files from build image diff --git a/webapp/Dockerfile.maintenance b/webapp/Dockerfile.maintenance index d6cd034e8..096995dca 100644 --- a/webapp/Dockerfile.maintenance +++ b/webapp/Dockerfile.maintenance @@ -50,7 +50,7 @@ CMD ["yarn", "run", "start"] ################################################################################## # CODE (Does contain all code files and is pushed to DockerHub for rebranding) ### ################################################################################## -FROM base as code +FROM base AS code COPY package.json yarn.lock ./ # yarn install @@ -78,7 +78,7 @@ COPY maintenance/source ./ ################################################################################## # BUILD ### TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO ## ################################################################################## -FROM code as build +FROM code AS build # yarn generate RUN yarn run generate @@ -86,7 +86,7 @@ RUN yarn run generate ################################################################################## # PRODUCTION ### TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO # TODO #### ################################################################################## -FROM nginx:alpine as production +FROM nginx:alpine AS production COPY --from=build ./app/dist/ /usr/share/nginx/html/ RUN rm /etc/nginx/conf.d/default.conf From 15bb2d24bf8a4857d99d81ff69a875afb23d9a3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20Hu=C3=9F?= Date: Thu, 29 Aug 2024 16:35:26 +0200 Subject: [PATCH 4/4] Fix warnings by removing 'version' from all Docker Compose YAMLs --- deployment/docker-compose.ocelotsocial-branded.yml | 2 -- deployment/docker-compose.yml | 2 +- docker-compose.maintenance.yml | 3 +-- docker-compose.override.yml | 2 -- docker-compose.test.yml | 2 -- docker-compose.yml | 2 -- 6 files changed, 2 insertions(+), 11 deletions(-) diff --git a/deployment/docker-compose.ocelotsocial-branded.yml b/deployment/docker-compose.ocelotsocial-branded.yml index 0c42d6273..b9ea2b434 100644 --- a/deployment/docker-compose.ocelotsocial-branded.yml +++ b/deployment/docker-compose.ocelotsocial-branded.yml @@ -1,6 +1,4 @@ # This docker-compose file is just here for testing -version: "3.4" - services: ######################################################## diff --git a/deployment/docker-compose.yml b/deployment/docker-compose.yml index e66b41f9f..145023f42 100644 --- a/deployment/docker-compose.yml +++ b/deployment/docker-compose.yml @@ -1,6 +1,6 @@ # This docker-compose file is just here for testing -version: "3.4" services: + webapp-base: image: ocelotsocialnetwork/webapp:local-base build: diff --git a/docker-compose.maintenance.yml b/docker-compose.maintenance.yml index b006713ec..1f2a2f5b4 100644 --- a/docker-compose.maintenance.yml +++ b/docker-compose.maintenance.yml @@ -1,8 +1,7 @@ # Todo: !!! This file seems related to our old maintenance worker for MongoDB and has to be refactored in case of using it !!! -version: "3.4" - services: + maintenance-worker: image: ocelotsocialnetwork/develop-maintenance-worker:latest build: diff --git a/docker-compose.override.yml b/docker-compose.override.yml index 1d8dbf966..d99ef9cfb 100644 --- a/docker-compose.override.yml +++ b/docker-compose.override.yml @@ -1,5 +1,3 @@ -version: "3.4" - services: ######################################################## diff --git a/docker-compose.test.yml b/docker-compose.test.yml index fa858f28c..9ee94801d 100644 --- a/docker-compose.test.yml +++ b/docker-compose.test.yml @@ -1,5 +1,3 @@ -version: "3.4" - services: ######################################################## diff --git a/docker-compose.yml b/docker-compose.yml index 55fe8b262..ed69e7f01 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,8 +3,6 @@ # is required to explicitly define if you want an production build: # > docker-compose -f docker-compose.yml up -version: "3.4" - services: ########################################################