Giter Club home page Giter Club logo

zope-docker's Introduction

The Zope-Docker - Rollout Zope-Stuff and Chill

tl;dr

  • Where should I mount for persistence?
    • /vol
  • Login credentials for zope manage user?
    • dockerzope:12345
    • This can be changed in the Dockerfile or in Zope
  • Login credentials for postgres?
    • user: zope
    • database: zopedb
    • pw: 12345

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

  • Zope
    • Batteries included!!
    • Products.PythonScripts
    • Products.ZSQLMethods
    • Products.SiteErrorLog
    • Products.StandardCacheManagers
    • Products.ExternalMethod
    • Products.MailHost
    • coming soon: Place a requirements.txt in the config-dir to install custom pip-packages
  • PostgreSQL
    • Containing a User (zope)
    • A Database (zopedb)
    • And prepared permissions for that user on that Database
  • Zeo
  • ZODBsync

How to Use

1. Build the docker-image

Linux

./BuildImage

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

  • Fully include HaProxy
    • And The Possibility to enable HTTPS
  • [DONE] Allow more configuration files to be edited
  • Add Possibility to add custom Products
  • Add Possibility to add a github-link as zoperepo
    • Fetch and playback everytime the container starts
  • Cleanup. This whole thing is a pretty huge case of "let's just try this"
  • Improve Windows compatibility

zope-docker's People

Contributors

klappson avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

zope-docker's Issues

This could be the beginning of a dream come true...

Strange title for an issue, I know…

This is a nice little docker approach, all-in-one, but I feel we could go much farther with this using a docker-compose approach.

Which would be to use one type of docker container for each component of our system, like so

  • One container for one Zope front-end (Zope process and helper tools, mostly from python-perfact)
  • One container for one ZEO back-end (ZEO process and zodbsync with git repository)
  • One container for PostgreSQL (we don't have to do that one ourselves, we can use what's there already)
  • One container for HAproxy (should be available, too)
  • One YAML file that binds them together with TCP, and exposes the result to the world

Then we could scale up by adding more Zope dockers, which we would then configure into HAproxy. Simple!

Kubernetes would also become an option…

So this is just me dreaming. If you find this intriguing and would like to explore more, that would make my day!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.