Skip to content

Monogramm/docker-dodock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

License: AGPL v3 GitHub Workflow Status Docker Automated buid Docker Pulls

Dodock custom Docker container

🐳 Docker image for Dodock applications.

This image was inspired by Monogramm's Frappe container and Dokos docker container:

The concept is the following:

  • no need to provide any configuration file: everything will be automatically generated by the container through environnment variables
  • the application container sets all the environment variables, the other containers wait for setup to be done
  • provide postgresql compatibility
  • the container detects and execute migration automatically
  • the container detects missing modules / apps and remove them automatically
  • allow before and after 'node' custom scripts

Check image Monogramm/docker-dokos to see how to expand this image and build dodock apps.

What is Dodock

Full-stack web application framework that uses Python and MariaDB on the server side and a tightly integrated client side library. Built for Dokos.

dokos.io

gitlab dodock

Supported tags

https://hub.docker.com/r/monogramm/docker-dodock/

  • develop-alpine3.12 develop-alpine3.12 alpine3.12 (images/develop/alpine3.12/Dockerfile)
  • develop-slim-buster develop-slim-buster slim-buster develop develop latest (images/develop/slim-buster/Dockerfile)

Auto configuration via environment variables

The image supports auto configuration via environment variables.

Docker entrypoint configuration

# The docker "node" type. Defines the behavior of the container.
# This can either be set through command argument or environment variable.
# Can be one of the following:
#   doctor
#   setup
#   setup-database
#   build-apps
#   update
#   backup
#   restore
#   migrate
#   app
#   scheduler
#   worker
#   worker-long
#   worker-short
#   node-socketio
WORKER_TYPE=

# Time in seconds container will wait for DB to be up
DOCKER_DB_TIMEOUT=120

# MariaDb hosts allowed to log to the DB.
# Only needed with mariadb when database created by dodock (dodock restricts to install IP by default).
# In this case, use 172.%.%.% to allow any container on docker network
DOCKER_DB_ALLOWED_HOSTS=

# Time in seconds container will wait for apps to be setup
DOCKER_APPS_TIMEOUT=600

# Time in seconds container will wait for sites to be setup
DOCKER_SITES_TIMEOUT=900

# Set to 1 to enable display of all log files if container crashes
DOCKER_DEBUG=

DOCKER_GUNICORN_BIND_ADDRESS=0.0.0.0
DOCKER_GUNICORN_PORT=8000
DOCKER_GUNICORN_WORKERS=4
DOCKER_GUNICORN_TIMEOUT=120
DOCKER_GUNICORN_LOGLEVEL=info

# If you want to enable SSL for Dokos App
# If using Let's Encrypt, you should set properties like this:
#   certfile=/etc/letsencrypt/live/my.domain.com/fullchain.pem
#   keyfile=/etc/letsencrypt/live/my.domain.com/privkey.pem
DOCKER_GUNICORN_CERTFILE=
DOCKER_GUNICORN_KEYFILE=

Dodock configuration

# List of dodock apps (space separated) to init on startup (bench install-app)
DODOCK_APP_INIT=

# Reset apps.txt
# If set to 1, apps.txt older content will be removed on startup and only contain the content of DODOCK_APP_INIT
DODOCK_APP_RESET=

# Protected apps that shall never be removed automatically
# Mostly used to secure that dodock and dokos are not removed due to misconfiguration
DODOCK_APP_PROTECTED=dodock

# Default protocol. Should either be http (default value) or https when using SSL.
DODOCK_DEFAULT_PROTOCOL=http

# Default site
DODOCK_DEFAULT_SITE=

# Default HTTP port. Should either be 80 (default value) or 443 when using SSL or any custom port defined for the NGinx reverse proxy.
DODOCK_HTTP_PORT=80

# Default backend port. Should either be 80 (default value) or any custom port defined for the app backend.
DODOCK_WEBSERVER_PORT=80

# Default socketion port. Should either be 3000 (default value) or 80 (usual value for prod) or any custom port defined for the socketio service.
DODOCK_SOCKETIO_PORT=3000

# Remove all sites data on startup if set to 1
# This should only be used for dev / test environments
DODOCK_RESET_SITES=

# Reinstall database
# If set to 1, database will be resinstalled. This should only be used for dev / test environments
DODOCK_REINSTALL_DATABASE=

# Build options passed to the bench build command
# Can be used with --restore to copy the public assets instead of symlinking them
DODOCK_BUILD_OPTIONS=

DODOCK_LOGGING=1

GOOGLE_ANALYTICS_ID=

DEVELOPER_MODE=0
ALLOW_TESTS=0
SERVER_SCRIPT_ENABLED=0

ADMIN_PASSWORD=dodock

# Encryption key
# Leave empty to generate a random base64 32 key
ENCRYPTION_KEY=

Database configuration

# DB type. Can either be mariadb or postgresql
DB_TYPE=mariadb

DB_HOST=db
DB_PORT=3306

# DB name. Is also used by dodock for the user name associated
DB_NAME=dodock
DB_PASSWORD=youshouldoverwritethis

# DB root login. Only used for postgresql
DB_ROOT_LOGIN=root

# DB root password. Mandatory
DB_ROOT_PASSWORD=mariadb_root_password

Mail configuration

MAIL_MUTED=false
MAIL_HOST=mail
MAIL_PORT=587
MAIL_USE_SSL=tls
MAIL_LOGIN=dodock-mail
MAIL_PASSWORD=youshouldoverwritethis

Redis configuration

REDIS_CACHE_HOST=redis_cache
REDIS_QUEUE_HOST=redis_queue
REDIS_SOCKETIO_HOST=redis_socketio

How to run this image

This image does not contain the database for Dodock. You need to use either an existing database or a database container.

This image is designed to be used in a micro-service environment using docker-compose. There are basically 2 variants of the image you can choose from: alpine or debian.

Running this image with docker-compose

  • Select the version closest to what you want in the images folder
    • You can comment the build lines, uncomment the image lines and edit versions to download prebuilt docker container.
  • Feel free to edit variables defined in .env as you see fit.
  • Run the docker-compose with docker-compose up -d and that's it.
  • Now, go to http://localhost:80 to access the first run installation wizard.

Questions / Issues

If you got any questions or problems using the image, please visit our Github Repository and write an issue.