Skip to content

galette-community/docker

Repository files navigation

Docker Stars Docker Pulls Docker Automated

Galette using Docker

Current repository hosts sources of the Galette docker image, created and maintained by Galette Community.

Contributing

If you want to contribute to containerized galette, take a look here.

Features

  • integrated plugins : events, fullcard, maps, objectslend and paypal
  • mount volume to keep persistent database settings (config.inc.php)
  • keep data (images, logs, etc) persistent by mounting volumes
  • enabling Log IP addresses behind a proxy (optional)
  • customize your CSS (volume)
  • user www-data instead of root
  • a crontab will run reminder.php (with user www-data) every day at 8:30am to send reminder mail
  • only webroot is exposed via Apache DocumentRoot and vhost
  • you can use reverse proxy to access Galette by domain or subdomain

Prerequisites

This docker image has no included database, so you need to have that separately. Since you probably already are running docker, take a look here for a guide on how to run MariaDB in a container.

How to use this image using docker command line

Galette has a really nice installer, that runs you through database setup and initial admin user creation. The installer creates a configuration files, which you will be interested in keeping on a volume outside the docker image, for reuse when you upgrade to a newer version.

Therefore it is really important that you follow this guide exactly.

If you are upgrading from an earlier version, you can skip the first two steps below.

  1. Create an empty file config.inc.php which you will mount as a volume in the next step.

    • It is important that you create this file. You can also take a copy of this, as the contents do not matter
  2. Start a container with the version of galette you want (perhaps :latest) and the proper list of volumes, take note of the config.inc.php volume which is a file.

    docker run  -d -p 8080:80 --name galette
    -v  /path/to/config.inc.php:/var/www/galette/config/config.inc.php \
    -v  /path/to/data/attachments:/var/www/galette/data/attachments \
    -v  /path/to/data/cache:/var/www/galette/data/cache \
    -v  /path/to/data/files:/var/www/galette/data/files \
    -v  /path/to/data/logs:/var/www/galette/data/logs \
    -v  /path/to/data/photos:/var/www/galette/data/photos \
    -v ./path/to/data/templates_c:/var/www/galette/data/templates_c \
    galette/galette:latest
    

    Remember to replace ./path/to/ with your own path.

  3. Run the installer: Open a browser to http://<ip or server name>:8080/installer.php, e.g. http://localhost:8080/installer.php and follow the instructions.

    • Remember your database details, as you will need them in this process.

    You're done!

    N.B.: You can check config.inc.php in container.

    docker exec galette cat /var/www/galette/config/config.inc.php

  4. As a subsequent security precaution, you should delete the galette installation files. Replace galette with the actual container name, if you changed that in the commands above.

    docker exec galette rm -r /var/www/galette/install

  5. Advanced configuration:

    Add the following volume to your container parameters to control logging of IP addresses behind a proxy, or to enable debugging mode. Read here for more info:

    -v ./path/to/config/behavior.inc.php:/var/www/galette/config/behavior.inc.php

    Add the folloing volume to your container parameters to enable custom styling via CSS. Read here for more info:

    v ./path/to/galette_local.css:/var/www/galette/webroot/themes/default/galette_local.css

    Remember to replace ./path/to/ with your own path.

Configure plugins

From the main page of galette, click the plugin icon and manage the built-in modules. You can disable/enable them an initialize their database configuration from the UI.

How to use this image using Docker Compose

  1. Copy docker-compose/galette/docker-compose.yml and docker-compose/galette/.env to the folder, where you want to persist your configuration.
  2. Optionally edit the values in .env
  3. Create a config folder and an empty config.inc.php in that folder. Or copy the one from here.
  4. Launch with docker-compose up -d
  5. Go to http://localhost:8080/installer.php and complete installation (database, etc).

You're done.

  1. See above for deleting the install folder, advanced configuration and plugin configuration! In the docker compose example file, there are commented out lines for the behavior or css volumes.

How to use this image AND a mariadb image using Docker Compose

  1. Copy docker-compose/galette-and-mariadb/docker-compose.yml and docker-compose/galette-and-mariadb/.env to the folder, where you want to persist your configuration.
  2. Edit the env file to set your database configuration. Don't skip this.
  3. Continue with the rest of the steps above
  • MariaDB takes some time to start, so have patience.
  • MariaDB and Galette will be running in two different containers. The MariaDB exposes its standard port 3306 according to the compose-configuration, so you can connect using the IP or hostname of the docker host, when you enter the database details in the galette installer.

Reverse proxy

Nginx

An example of reverse proxy configuration for Nginx is provided.