1
0
mirror of https://github.com/zokradonh/kopano-docker synced 2025-06-06 23:46:24 +00:00

add docker-file to run webapp standalone

tweak start.sh in webapp image so that it only gets the package list when there are actual packages to install

Signed-off-by: Felix Bartels <felix@host-consultants.de>
This commit is contained in:
Felix Bartels 2019-02-05 21:55:20 +01:00
parent 3b043334d5
commit 72846074d6
3 changed files with 52 additions and 4 deletions

View File

@ -82,10 +82,16 @@ This project includes a Docker container to easily inspect the data returned by
To get a quick impression of Kopano this git repository bundles a locally build ldap image with some example users. When using the docker-compose.yml in a production environment make sure to:
- either remove `ldap-demo/bootstrap/ldif/demo-users.ldif` from the locally built ldap image or complety remove the local ldap from the compose file
- either remove `ldap-demo/bootstrap/ldif/demo-users.ldif` from the locally built ldap image or completely remove the local ldap from the compose file
- adapt ldap queries in .env to match you actual ldap server and users
- all additional configuration of the Kopano components should be specified in the compose file and **not within the running container**
#### Can I combine these Docker images with my existing environment?
Yes, that is certainly a possibillity. Within the `examples/` directory you can find some ready to run examples that can be run in the following way:
- `docker-compose -f examples/webapp.yml up -d`
### Some more commands for those unfamilar with docker-compose
- Start ``docker-compose-yml`` file in the background: `docker-compose up -d`

42
examples/webapp.yml Normal file
View File

@ -0,0 +1,42 @@
version: "3.5"
services:
web:
image: ${docker_repo:?err}/kopano_web
container_name: web
restart: always
ports:
- "2015:2015"
- "${HTTP}:8080"
- "${HTTPS}:8443"
environment:
- EMAIL=${EMAIL}
- FQDN=${FQDN}
command: wrapper.sh
volumes:
- web:/.kweb
networks:
- web-net
kopano_webapp:
image: ${docker_repo:?err}/kopano_webapp:${WEBAPP_VERSION}
hostname: kopano_webapp
container_name: kopano_webapp
volumes:
- /etc/kopano/ssl:/kopano/ssl
- /run/kopano:/run/kopano
environment:
- TZ=${TZ}
# hostname of kopano system, leave empty for unix socket
- KCCONF_SERVERHOSTNAME=
# https port of kopano system
- KCCONF_SERVERPORT=
- ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS}
networks:
- web-net
volumes:
web:
networks:
web-net:

View File

@ -2,7 +2,7 @@
# define default value for serverhostname and serverport if not passed into container
KCCONF_SERVERHOSTNAME=${KCCONF_SERVERHOSTNAME:-127.0.0.1}
KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-236}
KCCONF_SERVERPORT=${KCCONF_SERVERPORT:-237}
ADDITIONAL_KOPANO_PACKAGES=${ADDITIONAL_KOPANO_PACKAGES:-""}
ADDITIONAL_KOPANO_WEBAPP_PLUGINS=${ADDITIONAL_KOPANO_WEBAPP_PLUGINS:-""}
@ -10,8 +10,8 @@ set -eu # unset variables are errors & non-zero return values exit the whole scr
ADDITIONAL_KOPANO_PACKAGES="$ADDITIONAL_KOPANO_PACKAGES $ADDITIONAL_KOPANO_WEBAPP_PLUGINS"
[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && apt update
[ ! -z "$ADDITIONAL_KOPANO_PACKAGES" ] && for installpkg in "$ADDITIONAL_KOPANO_PACKAGES"; do
[ ! -z ${ADDITIONAL_KOPANO_PACKAGES// } ] && apt update
[ ! -z ${ADDITIONAL_KOPANO_PACKAGES// } ] && for installpkg in "$ADDITIONAL_KOPANO_PACKAGES"; do
if [ $(dpkg-query -W -f='${Status}' $installpkg 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
apt --assume-yes install $installpkg;
fi