Skip to content

Commit

Permalink
remove unnecessary CONFIGURATIONS build arg
Browse files Browse the repository at this point in the history
  • Loading branch information
roschaefer committed Oct 24, 2024
1 parent a93cc66 commit 2bdaf7a
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 42 deletions.
10 changes: 4 additions & 6 deletions deployment/src/docker/backend.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,11 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE}
##################################################################################
FROM $APP_IMAGE_CODE AS code

ARG CONFIGURATION=example

# copy public constants and email templates into the Docker image to brand it
COPY configurations/${CONFIGURATION}/branding/constants/emails.ts src/config/
COPY configurations/${CONFIGURATION}/branding/constants/logos.ts src/config/
COPY configurations/${CONFIGURATION}/branding/constants/metadata.ts src/config/
COPY configurations/${CONFIGURATION}/branding/email/ src/middleware/helpers/email/
COPY ./branding/constants/emails.ts src/config/
COPY ./branding/constants/logos.ts src/config/
COPY ./branding/constants/metadata.ts src/config/
COPY ./branding/email/ src/middleware/helpers/email/

##################################################################################
# BUILD ##########################################################################
Expand Down
10 changes: 3 additions & 7 deletions deployment/src/docker/maintenance.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,13 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE}
##################################################################################
FROM $APP_IMAGE_CODE AS code

ARG CONFIGURATION=example

# copy public constants into the Docker image to brand it
COPY configurations/${CONFIGURATION}/branding/static/ static/
COPY configurations/${CONFIGURATION}/branding/constants/ constants/
COPY ./branding/static/ static/
COPY ./branding/constants/ constants/
RUN /bin/sh -c 'cd constants && for f in *.ts; do mv -- "$f" "${f%.ts}.js"; done'

# locales
COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/
COPY src/tools/ tools/
RUN apk add --no-cache bash jq
COPY ./branding/locales/*.json locales/tmp/
RUN tools/merge-locales.sh

##################################################################################
Expand Down
14 changes: 6 additions & 8 deletions deployment/src/docker/webapp.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,16 @@ ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE}
##################################################################################
FROM $APP_IMAGE_CODE AS code

ARG CONFIGURATION=example

# copy public constants into the Docker image to brand it
COPY configurations/${CONFIGURATION}/branding/static/ static/
COPY configurations/${CONFIGURATION}/branding/constants/ constants/
COPY ./branding/static/ static/
COPY ./branding/constants/ constants/
RUN /bin/sh -c 'cd constants && for f in *.ts; do mv -- "$f" "${f%.ts}.js"; done'
COPY configurations/${CONFIGURATION}/branding/locales/html/ locales/html/
COPY configurations/${CONFIGURATION}/branding/assets/styles/imports/ assets/styles/imports/
COPY configurations/${CONFIGURATION}/branding/assets/fonts/ assets/fonts/
COPY ./branding/locales/html/ locales/html/
COPY ./branding/assets/styles/imports/ assets/styles/imports/
COPY ./branding/assets/fonts/ assets/fonts/

# locales
COPY configurations/${CONFIGURATION}/branding/locales/*.json locales/tmp/
COPY ./branding/locales/*.json locales/tmp/
COPY src/tools/ tools/
RUN apk add --no-cache bash jq
RUN tools/merge-locales.sh
Expand Down
12 changes: 0 additions & 12 deletions deployment/src/tools/merge-locales.sh

This file was deleted.

15 changes: 6 additions & 9 deletions docker-compose.branded.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,31 +4,28 @@ services:
image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/webapp
build:
target: branded
context: ./deployment
dockerfile: ./src/docker/webapp.Dockerfile
context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/}
dockerfile: ./docker/webapp.Dockerfile
args:
CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social}
APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code
APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base

backend:
image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/backend
build:
target: branded
context: ./deployment
dockerfile: ./src/docker/backend.Dockerfile
context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/}
dockerfile: ./docker/backend.Dockerfile
args:
CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social}
APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code
APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base

maintenance:
image: ${IMAGE_REPOSITORY:-ghcr.io/ocelot-social-community/stage.ocelot.social}/maintenance
build:
target: branded
context: ./deployment
dockerfile: ./src/docker/maintenance.Dockerfile
context: ${CONTEXT:-./deployment/configurations/stage.ocelot.social/}
dockerfile: ./docker/maintenance.Dockerfile
args:
CONFIGURATION: ${CONFIGURATION:-stage.ocelot.social}
APP_IMAGE_TAG_CODE: ${OCELOT_VERSION:-latest}-code
APP_IMAGE_TAG_BASE: ${OCELOT_VERSION:-latest}-base

0 comments on commit 2bdaf7a

Please sign in to comment.