-
-
Notifications
You must be signed in to change notification settings - Fork 64
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
16 changed files
with
2,334 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,71 @@ | ||
FROM python:3.8-alpine | ||
|
||
ENV PIP=22.2.2 \ | ||
ZC_BUILDOUT=3.0.1 \ | ||
SETUPTOOLS=65.7.0 \ | ||
WHEEL=0.38.4 \ | ||
PLONE_MAJOR=5.2 \ | ||
PLONE_VERSION=5.2.13 \ | ||
PLONE_VERSION_RELEASE=Plone-5.2.13-UnifiedInstaller-1.0 \ | ||
PLONE_MD5=12c037fae9413385149e8677f8457b84 | ||
|
||
RUN addgroup -g 500 plone \ | ||
&& adduser -S -D -G plone -u 500 plone \ | ||
&& mkdir -p /plone/instance /data/filestorage /data/blobstorage | ||
|
||
COPY buildout.cfg /plone/instance/ | ||
|
||
RUN apk add --no-cache --virtual .build-deps \ | ||
build-base \ | ||
libc-dev \ | ||
zlib-dev \ | ||
libjpeg-turbo-dev \ | ||
libpng-dev \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
mariadb-dev \ | ||
openldap-dev \ | ||
pcre-dev \ | ||
postgresql-dev \ | ||
libffi-dev \ | ||
&& wget -O Plone.tgz https://launchpad.net/plone/$PLONE_MAJOR/$PLONE_VERSION/+download/$PLONE_VERSION_RELEASE.tgz \ | ||
&& echo "$PLONE_MD5 Plone.tgz" | md5sum -c - \ | ||
&& tar -zxvf Plone.tgz \ | ||
&& cp -rv ./$PLONE_VERSION_RELEASE/base_skeleton/* /plone/instance/ \ | ||
&& cp -v ./$PLONE_VERSION_RELEASE/buildout_templates/buildout.cfg /plone/instance/buildout-base.cfg \ | ||
&& pip install pip==$PIP setuptools==$SETUPTOOLS zc.buildout==$ZC_BUILDOUT wheel==$WHEEL \ | ||
# some package needs PyYAML 5.4.1, and this can only be built with cython<3.0.0 | ||
&& pip install "cython<3.0.0" && pip install --no-build-isolation pyyaml==5.4.1 \ | ||
&& cd /plone/instance \ | ||
&& buildout \ | ||
&& ln -s /data/filestorage/ /plone/instance/var/filestorage \ | ||
&& ln -s /data/blobstorage /plone/instance//var/blobstorage \ | ||
&& find /data -not -user plone -exec chown plone:plone {} \+ \ | ||
&& find /plone -not -user plone -exec chown plone:plone {} \+ \ | ||
&& rm -rf /Plone* \ | ||
&& apk del .build-deps \ | ||
&& apk add --no-cache --virtual .run-deps \ | ||
su-exec \ | ||
bash \ | ||
git \ | ||
rsync \ | ||
libldap \ | ||
libxml2 \ | ||
libxslt \ | ||
libjpeg-turbo \ | ||
mariadb-connector-c \ | ||
postgresql-client \ | ||
&& rm -rf /plone/buildout-cache/downloads/* | ||
|
||
VOLUME /data | ||
|
||
COPY docker-initialize.py docker-entrypoint.sh / | ||
|
||
EXPOSE 8080 | ||
WORKDIR /plone/instance | ||
|
||
HEALTHCHECK --interval=1m --timeout=5s --start-period=1m \ | ||
CMD nc -z -w5 127.0.0.1 8080 || exit 1 | ||
|
||
ENTRYPOINT ["/docker-entrypoint.sh"] | ||
CMD ["start"] |
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,106 @@ | ||
[buildout] | ||
extends = | ||
buildout-base.cfg | ||
|
||
index = https://pypi.org/simple/ | ||
|
||
extensions = | ||
effective-user = plone | ||
buildout-user = plone | ||
var-dir=/data | ||
user=admin:admin | ||
parts += | ||
zeo | ||
mrbob | ||
plonesite | ||
|
||
eggs += | ||
RelStorage[mysql,postgresql,oracle] | ||
pas.plugins.ldap | ||
|
||
[client1] | ||
recipe = | ||
|
||
[instance_base] | ||
resources = ${buildout:directory}/resources | ||
|
||
[zeo] | ||
<= zeoserver_base | ||
recipe = plone.recipe.zeoserver | ||
zeo-address = 8080 | ||
|
||
[instance] | ||
zcml-additional = | ||
<configure xmlns="http://namespaces.zope.org/zope" xmlns:plone="http://namespaces.plone.org/plone"> | ||
<plone:CORSPolicy | ||
allow_origin="http://localhost:3000,http://127.0.0.1:3000" | ||
allow_methods="DELETE,GET,OPTIONS,PATCH,POST,PUT" | ||
allow_credentials="true" | ||
expose_headers="Content-Length,X-My-Header" | ||
allow_headers="Accept,Authorization,Content-Type,X-Custom-Header,Lock-Token" | ||
max_age="3600" | ||
/> | ||
</configure> | ||
event-log-handler = StreamHandler | ||
event-log-args = (sys.stderr,) | ||
access-log-handler = StreamHandler | ||
access-log-args = (sys.stdout,) | ||
|
||
# Requires gcc, thus install it on image build | ||
[mrbob] | ||
recipe = zc.recipe.egg | ||
eggs = | ||
mr.bob | ||
bobtemplates.plone | ||
|
||
[plonesite] | ||
recipe = collective.recipe.plonesite | ||
instance = instance | ||
site-id = Plone | ||
profiles-initial = Products.CMFPlone:dependencies | ||
profiles = | ||
plonetheme.barceloneta:default | ||
plone.app.caching:default | ||
plone.app.contenttypes:plone-content | ||
plone.restapi:default | ||
upgrade-portal = False | ||
upgrade-all-profiles = False | ||
enabled = False | ||
|
||
[versions] | ||
setuptools = | ||
zc.buildout = | ||
|
||
plone.restapi = 8.43.1 | ||
plone.rest = 3.0.0 | ||
|
||
RelStorage = 3.4.5 | ||
argparse = 1.4.0 | ||
bda.cache = 1.3.0 | ||
bobtemplates.plone = 5.2.2 | ||
case-conversion = 2.1.0 | ||
collective.checkdocs = 0.2 | ||
collective.recipe.plonesite = 1.12.0 | ||
cx-Oracle = 8.3.0 | ||
isort = 5.11.5 | ||
mr.bob = 1.0.0 | ||
mysqlclient = 2.1.1 | ||
node = 1.2.1 | ||
node.ext.ldap = 1.2 | ||
node.ext.ugm = 1.1 | ||
odict = 1.9.0 | ||
pas.plugins.ldap = 1.8.2 | ||
passlib = 1.7.4 | ||
perfmetrics = 3.3.0 | ||
plumber = 1.7 | ||
psycopg2 = 2.9.3 | ||
pyasn1 = 0.5.0 | ||
pyasn1-modules = 0.3.0 | ||
python-ldap = 3.4.2 | ||
python-memcached = 1.59 | ||
regex = 2023.6.3 | ||
yafowil = 3.1.0 | ||
yafowil.plone = 4.0.0a5 | ||
yafowil.widget.array = 1.7 | ||
yafowil.widget.dict = 1.8 | ||
yafowil.yaml = 2.0 |
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,41 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
COMMANDS="adduser debug fg foreground help kill logreopen logtail reopen_transcript run show status stop wait" | ||
START="console start restart" | ||
|
||
# Fixing permissions for external /data volumes | ||
mkdir -p /data/blobstorage /data/cache /data/filestorage /data/instance /data/log /data/zeoserver | ||
mkdir -p /plone/instance/src | ||
find /data -not -user plone -exec chown plone:plone {} \+ | ||
find /plone -not -user plone -exec chown plone:plone {} \+ | ||
|
||
# Initializing from environment variables | ||
su-exec plone python /docker-initialize.py | ||
|
||
if [ -e "custom.cfg" ]; then | ||
if [ ! -e "bin/develop" ]; then | ||
buildout -c custom.cfg | ||
find /data -not -user plone -exec chown plone:plone {} \+ | ||
find /plone -not -user plone -exec chown plone:plone {} \+ | ||
su-exec plone python /docker-initialize.py | ||
fi | ||
fi | ||
|
||
# ZEO Server | ||
if [[ "$1" == "zeo"* ]]; then | ||
exec su-exec plone bin/$1 fg | ||
fi | ||
|
||
# Plone instance start | ||
if [[ $START == *"$1"* ]]; then | ||
exec su-exec plone bin/instance console | ||
fi | ||
|
||
# Plone instance helpers | ||
if [[ $COMMANDS == *"$1"* ]]; then | ||
exec su-exec plone bin/instance "$@" | ||
fi | ||
|
||
# Custom | ||
exec "$@" |
Oops, something went wrong.