|
1 |
| -ARG APP_IMAGE=ghcr.io/ocelot-social-community/ocelot-social/webapp |
2 | 1 | ARG APP_IMAGE_TAG_BASE=latest-base
|
3 | 2 | ARG APP_IMAGE_TAG_CODE=latest-code
|
4 |
| -ARG APP_IMAGE_BASE=${APP_IMAGE}:${APP_IMAGE_TAG_BASE} |
5 |
| -ARG APP_IMAGE_CODE=${APP_IMAGE}:${APP_IMAGE_TAG_CODE} |
6 | 3 |
|
7 |
| -################################################################################## |
8 |
| -# CODE (branded) ################################################################# |
9 |
| -################################################################################## |
10 |
| -FROM $APP_IMAGE_CODE AS code |
| 4 | +FROM ghcr.io/ocelot-social-community/ocelot-social/webapp:${APP_IMAGE_TAG_CODE} AS build |
11 | 5 |
|
12 |
| -# locales |
13 |
| -RUN tools/merge-locales.sh |
14 |
| - |
15 |
| -################################################################################## |
16 |
| -# BUILD ########################################################################## |
17 |
| -################################################################################## |
18 |
| -FROM code AS build |
19 |
| - |
20 |
| -# yarn install |
21 |
| -RUN yarn install --production=false --frozen-lockfile --non-interactive |
22 |
| -# yarn build |
23 |
| -RUN yarn run build |
24 |
| - |
25 |
| -################################################################################## |
26 |
| -# BRANDED (Does contain only "binary"- and static-files to reduce image size) #### |
27 |
| -################################################################################## |
28 |
| -FROM $APP_IMAGE_BASE AS branded |
29 |
| - |
30 |
| -# TODO - do all copying with one COPY command to have one layer |
31 |
| -# Copy "binary"-files from build image |
32 |
| -COPY --from=build ${DOCKER_WORKDIR}/.nuxt ./.nuxt |
33 |
| -COPY --from=build ${DOCKER_WORKDIR}/node_modules ./node_modules |
34 |
| -COPY --from=build ${DOCKER_WORKDIR}/nuxt.config.js ./nuxt.config.js |
35 |
| -# Copy static files |
36 |
| -# TODO - this seems not be needed anymore for the new rebranding |
37 |
| -# TODO - this should be one Folder containign all stuff needed to be copied |
38 |
| -COPY --from=build ${DOCKER_WORKDIR}/config/ ./config/ |
39 |
| -COPY --from=build ${DOCKER_WORKDIR}/constants ./constants |
40 |
| -COPY --from=build ${DOCKER_WORKDIR}/static ./static |
41 |
| -COPY --from=build ${DOCKER_WORKDIR}/locales ./locales |
42 |
| -COPY --from=build ${DOCKER_WORKDIR}/assets/styles/imports ./assets/styles/imports |
43 |
| -COPY --from=build ${DOCKER_WORKDIR}/assets/fonts ./assets/fonts |
44 |
| -# Copy package.json for script definitions (lock file should not be needed) |
45 |
| -COPY --from=build ${DOCKER_WORKDIR}/package.json ./package.json |
46 |
| - |
47 |
| -# Run command |
48 |
| -CMD /bin/sh -c "yarn run start" |
| 6 | +FROM ghcr.io/ocelot-social-community/ocelot-social/webapp:${APP_IMAGE_TAG_BASE} AS branded |
| 7 | +COPY --from=build /build . |
0 commit comments