forked from Ocelot-Social-Community/stage.ocelot.social
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3a9b0c1
commit e52438e
Showing
3 changed files
with
8 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
ARG APP_IMAGE=ghcr.io/ocelot-social-community/ocelot-social/backend | ||
ARG APP_IMAGE_TAG_BASE=latest-base | ||
ARG APP_IMAGE_TAG_CODE=latest-code | ||
ARG APP_IMAGE_BASE=${APP_IMAGE}:${APP_IMAGE_TAG_BASE} | ||
ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} | ||
FROM $APP_IMAGE_CODE AS build | ||
|
||
FROM $APP_IMAGE_BASE AS branded | ||
FROM ghcr.io/ocelot-social-community/ocelot-social/backend:${APP_IMAGE_TAG_CODE} AS build | ||
|
||
FROM ghcr.io/ocelot-social-community/ocelot-social/backend:${APP_IMAGE_TAG_BASE} AS branded | ||
COPY --from=build /build . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,7 @@ | ||
ARG APP_IMAGE=ghcr.io/ocelot-social-community/ocelot-social/maintenance | ||
ARG APP_IMAGE_TAG_BASE=latest-base | ||
ARG APP_IMAGE_TAG_CODE=latest-code | ||
ARG APP_IMAGE_BASE=${APP_IMAGE}:${APP_IMAGE_TAG_BASE} | ||
ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} | ||
|
||
################################################################################## | ||
# CODE (branded) ################################################################# | ||
################################################################################## | ||
FROM $APP_IMAGE_CODE AS code | ||
FROM ghcr.io/ocelot-social-community/ocelot-social/maintenance:${APP_IMAGE_TAG_CODE} as build | ||
|
||
# copy public constants into the Docker image to brand it | ||
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 ./branding/locales/*.json locales/tmp/ | ||
RUN tools/merge-locales.sh | ||
|
||
################################################################################## | ||
# BUILD ########################################################################## | ||
################################################################################## | ||
FROM code AS build | ||
|
||
# yarn install | ||
## unnicely done in $APP_IMAGE_CODE at the moment, see main repo | ||
# RUN yarn install --production=false --frozen-lockfile --non-interactive | ||
# yarn generate | ||
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 | ||
|
||
COPY --from=build ./app/dist/ /usr/share/nginx/html/ | ||
RUN rm /etc/nginx/conf.d/default.conf | ||
COPY --from=code ./app/maintenance/nginx/custom.conf /etc/nginx/conf.d/ | ||
COPY --from=build ./app/maintenance/nginx/custom.conf /etc/nginx/conf.d/default.conf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,7 @@ | ||
ARG APP_IMAGE=ghcr.io/ocelot-social-community/ocelot-social/webapp | ||
ARG APP_IMAGE_TAG_BASE=latest-base | ||
ARG APP_IMAGE_TAG_CODE=latest-code | ||
ARG APP_IMAGE_BASE=${APP_IMAGE}:${APP_IMAGE_TAG_BASE} | ||
ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} | ||
|
||
################################################################################## | ||
# CODE (branded) ################################################################# | ||
################################################################################## | ||
FROM $APP_IMAGE_CODE AS code | ||
FROM ghcr.io/ocelot-social-community/ocelot-social/webapp:${APP_IMAGE_TAG_CODE} AS build | ||
|
||
# locales | ||
RUN tools/merge-locales.sh | ||
|
||
################################################################################## | ||
# BUILD ########################################################################## | ||
################################################################################## | ||
FROM code AS build | ||
|
||
# yarn install | ||
RUN yarn install --production=false --frozen-lockfile --non-interactive | ||
# yarn build | ||
RUN yarn run build | ||
|
||
################################################################################## | ||
# BRANDED (Does contain only "binary"- and static-files to reduce image size) #### | ||
################################################################################## | ||
FROM $APP_IMAGE_BASE AS branded | ||
|
||
# TODO - do all copying with one COPY command to have one layer | ||
# Copy "binary"-files from build image | ||
COPY --from=build ${DOCKER_WORKDIR}/.nuxt ./.nuxt | ||
COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules | ||
COPY --from=build ${DOCKER_WORKDIR}/nuxt.config.js ./nuxt.config.js | ||
# Copy static files | ||
# TODO - this seems not be needed anymore for the new rebranding | ||
# TODO - this should be one Folder containign all stuff needed to be copied | ||
COPY --from=build ${DOCKER_WORKDIR}/config/ ./config/ | ||
COPY --from=build ${DOCKER_WORKDIR}/constants ./constants | ||
COPY --from=build ${DOCKER_WORKDIR}/static ./static | ||
COPY --from=build ${DOCKER_WORKDIR}/locales ./locales | ||
COPY --from=build ${DOCKER_WORKDIR}/assets/styles/imports ./assets/styles/imports | ||
COPY --from=build ${DOCKER_WORKDIR}/assets/fonts ./assets/fonts | ||
# Copy package.json for script definitions (lock file should not be needed) | ||
COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json | ||
|
||
# Run command | ||
CMD /bin/sh -c "yarn run start" | ||
FROM ghcr.io/ocelot-social-community/ocelot-social/webapp:${APP_IMAGE_TAG_BASE} AS branded | ||
COPY --from=build /build . |