-
Notifications
You must be signed in to change notification settings - Fork 8
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
Showing
4 changed files
with
37 additions
and
41 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
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,6 +1,6 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG PLONE_VERSION=6.0.11 | ||
FROM plone/server-builder:${PLONE_VERSION} as builder | ||
FROM plone/server-builder:${PLONE_VERSION} AS builder | ||
|
||
WORKDIR /app | ||
|
||
|
@@ -12,24 +12,21 @@ COPY . src | |
# Install local requirements and pre-compile mo files | ||
RUN <<EOT | ||
set -e | ||
bin/pip install mxdev uv | ||
mv src/requirements-docker.txt src/requirements.txt | ||
sed -i 's/-e .\[test\]/./g' src/mx.ini | ||
bin/pip install mxdev uv hatch | ||
cd /app/src | ||
# remove potentially existing virtualenv from local build | ||
rm -rf .venv | ||
../bin/hatch build | ||
../bin/mxdev -c mx.ini | ||
../bin/uv pip install -r requirements-mxdev.txt | ||
../bin/uv pip install dist/*.whl -c constraints-mxdev.txt | ||
../bin/python /compile_mo.py | ||
cd /app | ||
rm -Rf src/ | ||
rm -Rf /app/src | ||
EOT | ||
|
||
FROM plone/server-prod-config:${PLONE_VERSION} | ||
|
||
LABEL maintainer="Plone Foundation <[email protected]>" \ | ||
org.label-schema.name="volto-form-block-backend" \ | ||
org.label-schema.description="Project Title backend image." \ | ||
org.label-schema.description="Volto Form Block: Backend" \ | ||
org.label-schema.vendor="Plone Foundation" | ||
|
||
# Copy /app from builder | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# syntax=docker/dockerfile:1 | ||
ARG VOLTO_VERSION | ||
# TODO: Replace with | ||
# FROM plone/frontend-builder:${VOLTO_VERSION} | ||
# when the main image is ready | ||
FROM ghcr.io/kitconcept/frontend-builder:${VOLTO_VERSION} AS builder | ||
|
||
COPY --chown=node packages/volto-form-block /app/packages/volto-form-block | ||
COPY --chown=node volto.config.js /app/ | ||
COPY --chown=node package.json /app/package.json.temp | ||
|
||
RUN --mount=type=cache,id=pnpm,target=/app/.pnpm-store,uid=1000 <<EOT | ||
set -e | ||
python3 -c "import json; data = json.load(open('package.json.temp')); deps = data['dependencies']; data['dependencies'].update(deps); json.dump(data, open('package.json', 'w'), indent=2)" | ||
rm package.json.temp | ||
pnpm install && pnpm build:deps | ||
pnpm build | ||
pnpm install --prod | ||
EOT | ||
|
||
# TODO: Replace with | ||
# FROM plone/frontend-prod-config:${VOLTO_VERSION} | ||
# when the main image is ready | ||
FROM ghcr.io/kitconcept/frontend-prod-config:${VOLTO_VERSION} | ||
|
||
LABEL maintainer="Plone Collective <[email protected]>" \ | ||
org.label-schema.name="ghcr.io/collective/volto-form-block-frontend" \ | ||
org.label-schema.description="Volto Form Block" \ | ||
org.label-schema.vendor="Plone Collective" | ||
|
||
COPY --from=builder /app/ /app/ |