Skip to content

Add Dockerfiles + Compose#755

Open
parkingups69-netizen wants to merge 3 commits intoznuny:devfrom
parkingups69-netizen:dev
Open

Add Dockerfiles + Compose#755
parkingups69-netizen wants to merge 3 commits intoznuny:devfrom
parkingups69-netizen:dev

Conversation

@parkingups69-netizen
Copy link
Copy Markdown

@parkingups69-netizen parkingups69-netizen commented Dec 22, 2025

Proposed change

  • This PR creates a functional docker container stack based on the current dev branch.
  • This stack will boot to a functional instance, ready for installer.pl
  • Auto-configuration of the database host in Kernel/Config.pm
  • Preconfigured tuning parameters for MariaDB (max_allowed_packet, innodb_log_file_size) based on Znuny installation recommendations.

Type of change

1 - 🚀 feature' - New feature (which adds functionality to an existing integration)

Checklist

  • [x ] The code change is tested and works locally.(❗)
  • There is no commented out code in this PR.(❕)
  • You improved or added new unit tests.(❕)
  • Local ZnunyCodePolicy passed.(❕)
  • Local UnitTests / Selenium passed.(❕)
  • GitHub workflow CI (UnitTests / Selenium) passed.(❗)

@eyazi
Copy link
Copy Markdown
Contributor

eyazi commented Dec 26, 2025

Hey, this is a solid PoC and shows that Znuny can run in Docker, but I see a few structural issues for a default configuration:

  1. The entire application directory is mounted as a volume, which makes updates and rollbacks harder because application code and persistent data are mixed; usually only a few paths need to be persistent (e.g. Kernel/Config.pm, attachments, logs).
  2. Some environment-specific settings (like the database host and SMTP) are hardcoded.
  3. The daemon runs in the background instead of as the main container process, so Docker can’t reliably detect whether the daemon is running or restart it if it fails.

@parkingups69-netizen
Copy link
Copy Markdown
Author

@eyazi Thank you for the feedback, I'll refine the default configuration and post here when i've got news.

@parkingups69-netizen
Copy link
Copy Markdown
Author

@eyazi Hey, i've updated the PR:

The entire application directory is mounted as a volume, which makes updates and rollbacks harder because application code and persistent data are mixed; usually only a few paths need to be persistent (e.g. Kernel/Config.pm, attachments, logs).
Moved Config.pm to a custom directory (/persistent) and symlinking it, this directory is a volume
A seperate volume for these directories:
/opt/znuny/var/log
/opt/znuny/var/article
/opt/znuny/var/httpd/htdocs/custom
I'm personally not aware of more things that would need to be provided as standard, as my knowledge is limited of the inner workings of Znuny.

Some environment-specific settings (like the database host and SMTP) are hardcoded.
Added env vars for DB settings, injected in config.pm during container boot (only when they are default values, to leave any custom config alone)
SMTP settings are saved in the DB i thought?

The daemon runs in the background instead of as the main container process, so Docker can’t reliably detect whether the daemon is running or restart it if it fails.
Moved to using a watchdog script, it will force restart the container if daemon is down for more than 5 minutes
Using the daemon start script wasn't an option as it exits when the daemon is already running. (Had some goofy behaviour)

@parkingups69-netizen
Copy link
Copy Markdown
Author

@rkaldung Have you had a chance to review this yet?

@rkaldung
Copy link
Copy Markdown
Member

rkaldung commented Feb 12, 2026

@rkaldung Have you had a chance to review this yet?

Only on a high level because we're right in the pre-release of 7.3. The detailed review is on my agenda right after the release.

@rkaldung
Copy link
Copy Markdown
Member

rkaldung commented Apr 7, 2026

@parkingups69-netizen We won't merge this PR, but use it as the initial commit for https://github.com/znuny/znuny-docker

@rkaldung rkaldung added 1 - 🚀 feature New feature or request 2 - work in progress We are on it. and removed 2 - wait for reviewer Znuny, it's your turn. labels Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 - 🚀 feature New feature or request 2 - work in progress We are on it.

Development

Successfully merging this pull request may close these issues.

3 participants