Coder Social home page Coder Social logo

flipmcf / plone-backend Goto Github PK

View Code? Open in Web Editor NEW

This project forked from plone/plone-backend

0.0 1.0 0.0 65 KB

Plone backend Docker images using Python 3 and pip.

License: GNU General Public License v2.0

Makefile 24.44% Shell 39.04% Python 36.53%

plone-backend's Introduction

plone-backend

Plone backend Docker images using Python 3 and pip.

NOTE: These images are not yet officially supported by the Plone Community.

Supported tags and respective Dockerfile links

Plone 5.2 (Stable Plone)

Plone 6 (Next Plone Release)

Using this image

Simple usage

docker run -p 8080:8080 plone/plone-backend:6.0.0a1

Then point your browser at http://localhost:8080 and you should see the default Plone site creation page.

ZEO Server

This image supports ZEO clusters natively, and to use it

Create a directory for your project, and inside it create a docker-compose.yml file that starts your Plone instance and the ZEO instance with volume mounts for data persistence:

version: "3"
services:

  backend:
    image: plone/plone-backend:6.0.0a1
    restart: always
    environment:
      ZEO_ADDRESS: zeo:8100
    ports:
    - "8080:8080"
    depends_on:
      - zeo

  zeo:
    image: plone/plone-zeo:latest
    restart: always
    volumes:
      - data:/data
    ports:
    - "8100:8100"

volumes:
  data: {}

Now, run docker-compose up -d from your project directory.

Point your browser at http://localhost:8080 and you should see the default Plone site creation page.

Persisting data

There are several ways to store data used by applications that run in Docker containers.

We encourage users of the Plone images to familiarize themselves with the options available.

The Docker documentation is a good starting point for understanding the different storage options and variations.

Extending from this image

In a directory create a Dockerfile file:

FROM plone/plone-backend:6.0.0a1

RUN ./bin/pip install "relstorage==3.4.5" "psycopg[binary]==3.0.1 --use-deprecated legacy-resolver"

Also create a requirements.txt file, with packages to be installed:

pas.plugin.authomatic

Build your new image

docker build . -t myproject:latest -f Dockerfile

And start a container with

docker run -p 8080:8080 myproject:latest

Configuration Variables

Addons installation

It is possible to install, during startup time, addons in a container created using this image. To do so, pass the ADDONS environment variable with a list (separated by space) of requirements to be added to the image:

docker run -p 8080:8080 -e ADDONS="pas.plugins.authomatic" plone/plone-backend:6.0.0a1

This approach also allows you to test Plone with a specific version of one of its core components

docker run -p 8080:8080 -e ADDONS="plone.volto==3.1.0a3" plone/plone-backend:6.0.0a1

NOTE: We advise against using this feature on production environments. In this case, extend the image as explained before.

Main variables

Environment variable Zope option Default value
DEBUG_MODE debug-mode off
SECURITY_POLICY_IMPLEMENTATION security-policy-implementation C
VERBOSE_SECURITY verbose-security false
DEFAULT_ZPUBLISHER_ENCODING default-zpublisher-encoding utf-8

ZEO

To use a ZEO database, you need to pass the ZEO_ADDRESS to the image:

version: "3"
services:

  backend:
    image: plone/plone-backend:6.0.0a1
    restart: always
    environment:
      ZEO_ADDRESS: zeo:8100   
    ports:
    - "8080:8080"
    depends_on:
      - zeo

  zeo:
    image: plone/plone-zeo:latest
    restart: always
    volumes:
      - data:/data
    ports:
    - "8100:8100"

volumes:
  data: {}

A list of supported environment variables for ZEO:

Environment variable ZEO option Default value
ZEO_SHARED_BLOB_DIR name off
ZEO_READ_ONLY read-only false
ZEO_CLIENT_READ_ONLY_FALLBACK read-only-fallback false
ZEO_STORAGE storage 1
ZEO_CLIENT_CACHE_SIZE cache-size 128MB
ZEO_DROP_CACHE_RATHER_VERIFY drop-cache-rather-verify false

Relational Database

NOTE: Currently this image supports only the configuration of PostgreSQL backends via configuration variables. If you need to you MySQL or Oracle we recommend you to extend this image and overwrite the /app/etc/relstorage.conf file.

To use a PostgreSQL database, you need to pass the RELSTORAGE_DSN to the image:

version: "3"
services:

  backend:
    image: plone/plone-backend:6.0.0a1
    environment:
      RELSTORAGE_DSN: "dbname='plone' user='plone' host='db' password='plone'"
    ports:
    - "8080:8080"
    depends_on:
      - db

  db:
    image: postgres
    environment:
      POSTGRES_USER: plone
      POSTGRES_PASSWORD: plone
      POSTGRES_DB: plone
    ports:
    - "5432:5432"

A valid PostgreSQL DSN is a list of parameters separated with whitespace. A typical DSN looks like dbname='zodb' user='username' host='localhost' password='pass'.

A list of supported environment variables for Relstorage:

Environment variable RelStorage option Default value
RELSTORAGE_NAME name storage
RELSTORAGE_READ_ONLY read-only off
RELSTORAGE_KEEP_HISTORY keep-history true
RELSTORAGE_COMMIT_LOCK_TIMEOUT commit-lock-timeout 30
RELSTORAGE_CREATE_SCHEMA create-schema true
RELSTORAGE_SHARED_BLOB_DIR shared-blob-dir false
RELSTORAGE_BLOB_CACHE_SIZE blob-cache-size 100mb
RELSTORAGE_BLOB_CACHE_SIZE_CHECK blob-cache-size-check 10
RELSTORAGE_BLOB_CACHE_SIZE_CHECK_EXTERNAL blob-cache-size-check-external false
RELSTORAGE_BLOB_CHUNK_SIZE blob-chunk-size 1048576
RELSTORAGE_CACHE_LOCAL_MB cache-local-mb 10
RELSTORAGE_CACHE_LOCAL_OBJECT_MAX cache-local-object-max 16384
RELSTORAGE_CACHE_LOCAL_COMPRESSION cache-local-compressione none
RELSTORAGE_CACHE_DELTA_SIZE_LIMIT cache-delta-size-limit 100000

Contribute

Please DO NOT commit to main directly. Even for the smallest and most trivial fix. ALWAYS open a pull request and ask somebody else to merge your code. NEVER merge it yourself.

License

The project is licensed under the GPLv2.

plone-backend's People

Contributors

ericof avatar mamico avatar silviot avatar

Watchers

 avatar

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.