-
Notifications
You must be signed in to change notification settings - Fork 119
Add initial Dockerfile and docker-compose for Znuny rel-7_1_7 container deployment #680
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
+120
−0
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| FROM ubuntu:jammy | ||
| LABEL org.opencontainers.image.authors="Bohdan Klymonchuk" \ | ||
| org.opencontainers.image.title="znuny" \ | ||
| org.opencontainers.image.description="Based on https://doc.znuny.org/" | ||
|
|
||
| # Znuny version and environment | ||
| ARG ZNUNY_VERSION=7.1.7 | ||
| ARG ZNUNY_USER=znuny | ||
| ENV ZNUNY_HOME=/opt/znuny-${ZNUNY_VERSION} \ | ||
| PATH=$PATH:/opt/znuny-${ZNUNY_VERSION}/bin | ||
|
|
||
| # Install all system packages and Perl modules, then clean caches | ||
| RUN apt-get update && \ | ||
| DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
| wget apache2 mariadb-client cpanminus cron vim \ | ||
| libdbd-odbc-perl libapache2-mod-perl2 \ | ||
| libdbd-mysql-perl libtimedate-perl libnet-dns-perl libnet-ldap-perl \ | ||
| libio-socket-ssl-perl libpdf-api2-perl libsoap-lite-perl \ | ||
| libtext-csv-xs-perl libjson-xs-perl libapache-dbi-perl \ | ||
| libxml-libxml-perl libxml-libxslt-perl libyaml-perl \ | ||
| libarchive-zip-perl libcrypt-eksblowfish-perl libencode-hanextra-perl \ | ||
| libmail-imapclient-perl libtemplate-perl libdatetime-perl libmoo-perl \ | ||
| bash-completion libyaml-libyaml-perl libjavascript-minifier-xs-perl \ | ||
| libcss-minifier-xs-perl libauthen-sasl-perl libauthen-ntlm-perl \ | ||
| libdbd-pg-perl libcrypt-jwt-perl libcrypt-openssl-x509-perl \ | ||
| libhash-merge-perl libical-parser-perl libspreadsheet-xlsx-perl \ | ||
| nullmailer uuid-dev build-essential && \ | ||
| echo "smtp.unibas.ch" > /etc/nullmailer/remotes && \ | ||
| apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| RUN cpanm --notest --force Jq Data::UUID && \ | ||
| apt-get purge -y uuid-dev build-essential && \ | ||
| apt-get autoremove -y && \ | ||
| apt-get clean && rm -rf /var/lib/apt/lists/* | ||
|
|
||
| WORKDIR ${ZNUNY_HOME} | ||
| COPY . . | ||
|
|
||
| # Create ZNUNY user, configure and set permissions | ||
| RUN useradd -d ${ZNUNY_HOME} -c "Znuny user" \ | ||
| -g www-data -s /bin/bash -M -N ${ZNUNY_USER} && \ | ||
| cp Kernel/Config.pm.dist Kernel/Config.pm && \ | ||
| sed -i "s/\$Self->{DatabaseHost} = '127\.0\.0\.1';/\$Self->{DatabaseHost} = 'znuny_db';/" Kernel/Config.pm && \ | ||
| bin/znuny.SetPermissions.pl --znuny-user ${ZNUNY_USER} | ||
|
|
||
| # Rename default cron jobs | ||
| RUN su - znuny -c "cd ${ZNUNY_HOME}/var/cron && for f in *.dist; do cp \$f \$(basename \$f .dist); done " | ||
|
|
||
| # Configure Apache for Znuny | ||
| RUN a2dismod mpm_event && \ | ||
| a2enmod mpm_prefork perl headers deflate filter cgi rewrite && \ | ||
| ln -s ${ZNUNY_HOME}/scripts/apache2-httpd.include.conf /etc/apache2/conf-available/zzz_znuny.conf && \ | ||
| a2enconf zzz_znuny && \ | ||
| echo "RedirectMatch ^/$ /znuny/index.pl" >> /etc/apache2/apache2.conf | ||
|
|
||
| # Fix file permissions | ||
| RUN find ${ZNUNY_HOME}/var/httpd -type d -exec chmod 775 {} \; && \ | ||
| find ${ZNUNY_HOME}/var/httpd -type f -exec chmod 664 {} \; && \ | ||
| chown -R ${ZNUNY_USER}:www-data /tmp | ||
|
|
||
| RUN ln -s ${ZNUNY_HOME} /opt/znuny && \ | ||
| ln -s ${ZNUNY_HOME} /opt/otrs && \ | ||
| mv ${ZNUNY_HOME}/Kernel/System/Ticket/CustomExample.pm ${ZNUNY_HOME}/Kernel/System/Ticket/Custom.pm | ||
|
|
||
| EXPOSE 80 | ||
|
|
||
| # Start services and launch Apache in foreground | ||
| ENTRYPOINT ["/bin/bash", "-c"] | ||
| CMD ["service nullmailer start && service cron start && source /etc/apache2/envvars && apache2 -DFOREGROUND"] | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| networks: | ||
| znuny-net: | ||
| driver: bridge | ||
|
|
||
| volumes: | ||
| znuny_db_data: | ||
| znuny_httpd_data: | ||
|
|
||
| services: | ||
| znuny: | ||
| build: | ||
| context: . | ||
| dockerfile: Dockerfile | ||
| image: znuny:${ZNUNY_VERSION:-7.1.7} | ||
| container_name: znuny_httpd | ||
| mem_limit: ${ZNUNY_MEMLIMIT:-2048m} | ||
| privileged: true | ||
| depends_on: | ||
| - mariadb | ||
| volumes: | ||
| - znuny_httpd_data:/opt/znuny | ||
| restart: ${RESTART:-unless-stopped} | ||
| ports: | ||
| - "${HTTP_PORT:-8080}:80" | ||
| networks: | ||
| - znuny-net | ||
| labels: | ||
| org.label-schema.group: "znuny" | ||
|
|
||
| mariadb: | ||
| image: mariadb:${MARIADB_VERSION:-11.4.7} | ||
| container_name: znuny_db | ||
| mem_limit: ${ZNUNY_DB_MEMLIMIT:-2048m} | ||
| environment: | ||
| MYSQL_ROOT_PASSWORD: ${ROOT_PASS:-root-pass} | ||
| MYSQL_DATABASE: ${DATA_BASE_NAME:-znuny} | ||
| MYSQL_USER: ${DB_USER:-znuny} | ||
| MYSQL_PASSWORD: ${DB_USER_PASS:-some-pass} | ||
| volumes: | ||
| - znuny_db_data:/var/lib/mysql | ||
| restart: ${RESTART:-unless-stopped} | ||
| ports: | ||
| - "${DB_PORT:-3306}:3306" | ||
| networks: | ||
| - znuny-net | ||
| command: [ | ||
| "--max_allowed_packet=256M", | ||
| "--innodb_log_file_size=512M" | ||
| ] | ||
| labels: | ||
| org.label-schema.group: "znuny" |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.