Klappson / zope-docker

Rollout Zope-Stuff and Chill
3 stars 0 forks source link
docker docker-image dockerfile zeo zodbsync zope zope5

The Zope-Docker - Rollout Zope-Stuff and Chill

tl;dr

The problem I want to address

The Idea behind this is that rolling out a zope-project is a pain in the arse.

ATM if you want to rollout a zope-project you have to setup the python-env, install products, create a database, prepare the database load the Data.FS and so on. If you are reading this, you might know what I'm talking about at this point

This docker will create a zope-installation where this whole spiel is already done for you! Your zope-project will only be a dir consisting of a zoperepo-dir, which contains a ZODBsync dump and a config-dir, which will contain various config files. (More dirs/files may be added in the future, but the spirit will be kept)


What does this setup contain ATM

Windows

docker build -t klappson/docker-zope-setup .

2. Create the container

Linux

./StartDocker

Windows

docker run \
    -p 8080:8080 \
    -it \
    --name zope-docker \
    klappson/docker-zope-setup

THAT'S IT! The Zope-Server will be available at http://127.0.0.1:8080

Persistence and the reason we are here

Since we are here to rollout zope-projects and chill. This wouldn't make much sense if we could not shove any of our projects inside the container.

In order to to so, just add a bind-mount to your container at /vol

This can be done by adding the "--mount" parameter to your docker run command

--mount type=bind,source=<FOLDER ON YOUR MACHINE>,target=/vol

Contents of /vol

/vol/zoperepo

This folder will contain a ZODBsync dump of zope's Data.FS.

A ZODBsync dump is basically a representation of zope's folder structure but on a normal file-system. The contents of this folder will be shoved into the Data.FS on every startup of the container

/vol/postgres_data

This folder is a postgres data dir. it's just there to ensure persistence of the postgres-DB.

Keep in mind that you should not add this dir to any git repos. You will run into problems regarding permissions and stuff

/vol/config

This folder will contain some configs I tough most people would like to edit. If your favorite config-file is missing, feel free to create an issue (or a PR 👀).

Inside the container the files inside this dir will be symlinked to the right location


Planned