changed to use configuration files

This commit is contained in:
andreas
2023-04-02 20:36:59 +00:00
parent 878e544e87
commit 694aab86f3
8 changed files with 17 additions and 26 deletions

2
.env
View File

@@ -1,3 +1,3 @@
# database credentials
MYSQL_ROOT_PASSWORD=modT9&?.
MYSQL_KOPANO_PASSWORD=Asdf2345
MYSQL_KOPANO_PASSWORD=zAKt(85&

View File

@@ -19,10 +19,7 @@ EOF
# use envsubst in entrypoint script to convert config templates to actual config files
COPY --chmod=0775 entrypoint.sh /entrypoint.sh
# https://documentation.kopano.io/kopanocore_administrator_manual/configure_kc_components.html#configure-kopano-dagent-for-delivery-via-unix-socket
EXPOSE 110
EXPOSE 143
EXPOSE 236
EXPOSE 8443
VOLUME /etc/kopano
VOLUME /var/lib/kopano/attachments
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -1,6 +1,6 @@
#!/usr/bin/bash
# export DOCKER_BUILDKIT=1
docker run -d --rm --name www -p80:80 -v/root/kopano-docker/dist:/usr/local/apache2/htdocs httpd
docker run -d --rm --name dist -p80:80 -v/root/kopano-docker/dist:/usr/local/apache2/htdocs httpd
docker build --no-cache --progress=plain -t core .
docker build -t core .
docker run --rm -it --name core -p8081:80 core bash

View File

@@ -1,10 +1,5 @@
#!/usr/bin/env bash
set -e
sed -i \
-e's/#mysql_host = localhost/mysql_host = mysql/' \
-e's/#mysql_user = root/mysql_user = kopano/' \
-e's/#mysql_password =/mysql_password = Asdf2345/' \
/etc/kopano/server.cfg
# runas user kopano
chown kopano:kopano /var/lib/kopano/attachments
exec "$@"

View File

@@ -1,11 +1,12 @@
services:
server:
build: ./core
image: core
depends_on:
- mysql
volumes:
- attachments:/var/lib/kopano/attachments
- ./core/entrypoint.sh:/entrypoint.sh
- ./etc-zntrl/kopano:/etc/kopano:ro
command: /usr/sbin/kopano-server
mysql:
image: mysql:5.7
@@ -48,7 +49,7 @@ volumes:
# image: webapp
# labels:
# - traefik.enable=true
# - traefik.http.routers.webapp.rule=Host(`$MAIL_DOMAIN`) && Path(`/webapp`)
# - traefik.http.routers.webapp.rule=Host(`$MAIL_DOMAIN`) && PathPrefix(`/webapp`)
# - traefik.http.routers.webapp.tls=true
# - traefik.http.routers.webapp.tls.certResolver=default
# depends_on:
@@ -60,7 +61,7 @@ volumes:
# image: z-push
# labels:
# - traefik.enable=true
# - traefik.http.routers.webapp.rule=Host(`$MAIL_DOMAIN`) && Path(`/Active-Sync-...`)
# - traefik.http.routers.webapp.rule=Host(`$MAIL_DOMAIN`) && PathPrefix(`/Active-Sync-...`)
# - traefik.http.routers.webapp.tls=true
# - traefik.http.routers.webapp.tls.certResolver=default
# volumes:

View File

@@ -24,7 +24,7 @@ server_name = mail.zntrl.de
#enable_distributed_kopano = false
database_engine = mysql
mysql_host = localhost
mysql_host = mysql
mysql_port = 3306
mysql_user = kopano
mysql_password = zAKt(85&
@@ -36,8 +36,8 @@ mysql_database = kopano
# Space-separated list of users that are considered Kopano admins.
local_admin_users = root kopano
log_method = file
log_file = /var/log/kopano/server.log
# log_method = file
# log_file = /var/log/kopano/server.log
# Loglevel (0(none), 1(crit), 2(err), 3(warn), 4(notice), 5(info), 6(debug))
log_level = 5
log_timestamp = yes

View File

@@ -1,8 +1,6 @@
#!/usr/bin/env bash
docker exec -it kopano-mysql-1 sh <<DCKR
mysql -u root -p <<SQL
CREATE USER 'kopano' IDENTIFIED BY 'Asdf2345';
GRANT ALL ON kopano.* TO 'kopano'@'%';
DROP DATABASE kopano;
SQL
DCKR
# ssh mars 'tar czf - /var/lib/kopano/attachments' | docker exec -i kopano-server-1 bash -c 'cd /var/lib/kopano/attachments; tar tvzf -'
# docker stop kopano-server-1
# ssh mars 'tar czf - /var/lib/kopano/attachments' | docker run --rm -i --volumes-from kopano-server-1 ubuntu:20.04 bash -c 'cd /var/lib/kopano/attachments; tar tvzf -'
docker exec -it kopano-mysql-1 sh -c 'mysql -u root --password=\'modT9&?.\' -e \'DROP DATABASE kopano; CREATE SCHEMA kopano;\''
ssh mars 'mysqldump --single-transaction --routines zarafa' | docker exec -i kopano-mysql-1 sh -c 'mysql -u kopano --password=\'zAKt(85&\' kopano'

View File

@@ -12,10 +12,10 @@ bind-address = 0.0.0.0
#
# * Fine Tuning
#
key_buffer_size = 16M
# key_buffer_size = 16M
max_allowed_packet = 16M
thread_stack = 192K
thread_cache_size = 8
# thread_stack = 192K
# thread_cache_size = 8
# This replaces the startup script and checks MyISAM tables if needed
# the first time they are touched
myisam-recover-options = BACKUP