digibib / koha-docker

Koha docker image builders
MIT License
53 stars 18 forks source link

Error while loading /etc/koha/plack.psgi #19

Open lebowski42 opened 5 years ago

lebowski42 commented 5 years ago

Hi,

i'm trying to run koha in docker. I'm using the letsencrypt-nginx-proxy-companion. I append the dockerfile

After starting docker and access the instance using a browser first i get

Sorry! The Koha site you are trying to access is currently unavailable, probably because of maintenance. This is > not at all your fault, and we apologize for any inconvenience the downtime may cause you. Please check > back in a while. We hope to get things back up soon.

after a few settings i get

504 Gateway Time-out

The docker logs for koha give me:

koha                                 | Use of uninitialized value $home in concatenation (.) or string at /etc/koha  /plack.psgi line 54.
koha                                 | Use of uninitialized value $home in concatenation (.) or string at /etc/koha/plack.psgi line 58.
koha                                 | Use of uninitialized value $home in concatenation (.) or string at /etc/koha/plack.psgi line 74.
koha                                 | Error while loading /etc/koha/plack.psgi: Cannot find current script '/api/v1/app.pl' at /usr/share/perl5/Mojo/Server.pm line 48.
lebowski42 commented 5 years ago

Oh, i cannot append the file, so i paste it here:

version: "2"

services:
  nginx:
    restart: always
    image: nginx
    container_name: nginx
    networks: 
     - proxy-net
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - "/etc/nginx/conf.d"
      - "/etc/nginx/vhost.d"
      - "/usr/share/nginx/html"
      - "./volumes/proxy/certs:/etc/nginx/certs:ro"

  nginx-gen:
    restart: always
    image: jwilder/docker-gen
    container_name: nginx-gen
    networks: 
     - proxy-net
    volumes:
      - "/var/run/docker.sock:/tmp/docker.sock:ro"
      - "./volumes/proxy/templates/nginx.tmpl:/etc/docker-gen/templates/nginx.tmpl:ro"
    volumes_from:
      - nginx
    entrypoint: /usr/local/bin/docker-gen -notify-sighup nginx -watch -wait 5s:30s /etc/docker-gen/templates/nginx.tmpl /etc/nginx/conf.d/default.conf

  letsencrypt-nginx-proxy-companion:
    restart: always
    image: jrcs/letsencrypt-nginx-proxy-companion
    container_name: letsencrypt-nginx-proxy-companion
    networks: 
     - proxy-net
    volumes_from:
      - nginx
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"
      - "./volumes/proxy/certs:/etc/nginx/certs:rw"
    environment:
      - NGINX_DOCKER_GEN_CONTAINER=nginx-gen

##############
### MOODLE ###
##############

  mariadb:
    image: bitnami/mariadb:latest
    networks: 
     - proxy-net
    container_name: mariadb
    environment:
      - MARIADB_USER=db_moodle
      - MARIADB_DATABASE=moodle
      - ALLOW_EMPTY_PASSWORD=no
      - MARIADB_ROOT_PASSWORD=secret
      - MARIADB_PASSWORD=secret
    volumes:
      - 'mariadb_data:/bitnami'

  moodle:
    image: bitnami/moodle:latest
    networks: 
     - proxy-net
    environment:
      - MARIADB_HOST=mariadb
      - MARIADB_PORT_NUMBER=3306
      - MOODLE_DATABASE_USER=db_moodle
      - MOODLE_DATABASE_NAME=moodle
      - MOODLE_USERNAME=root
      - MOODLE_EMAIL=admin@my-website.net
      - MOODLE_LANGUAGE=en
      - MOODLE_SITENAME=moodle
      - MOODLE_PASSWORD=secret
      - ALLOW_EMPTY_PASSWORD=no
      - MOODLE_DATABASE_PASSWORD=secret
      - VIRTUAL_HOST=moodle.my-website.net
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=80
      - LETSENCRYPT_HOST=moodle.my-website.net
      - LETSENCRYPT_EMAIL=admin@my-website.net
    volumes:
      - 'moodle_data:/bitnami'
    depends_on:
      - mariadb

#############################
### nextcloud / collabora ###
#############################

  cloud-db:
    container_name: nextclouddb
    image: mariadb:latest
    networks:
      - proxy-net
    restart: always
    volumes:
      - 'nextclouddb_data:/var/lib/mysql'
    environment:
      MYSQL_DATABASE: nextcloud
      MYSQL_ROOT_PASSWORD: strenggeheim
      MYSQL_USER: nextcloud_user
      MYSQL_PASSWORD: secret

  cloud-app:
    depends_on:
      - cloud-db
    container_name: nextcloud
    image: nextcloud:latest
    networks:
      - proxy-net
    restart: always
    volumes:
      - 'nextcloud:/var/www/html' 
      - 'nextcloud_apps:/var/www/html/custom_apps' 
      - 'nextcloud_config:/var/www/html/config' 
      - 'nextcloud_data:/var/www/html/data' 
    environment:
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=8000
      - VIRTUAL_HOST= cloud.my-website.net
      - LETSENCRYPT_HOST=cloud.my-website.net
      - LETSENCRYPT_EMAIL=admin@my-website.net
#      - MYSQL_DATABASE= ${MYSQL_DATABASE}
#      - MYSQL_USER= ${MYSQL_USER}
#      - MYSQL_PASSWORD= ${MYSQL_PASSWORD}
#      - MYSQL_HOST= ${MYSQL_HOST}

############
### koha ###
############

  koha:
    container_name: koha
    image: "digibib/koha:${GITREF}"
    networks:
      - proxy-net
    depends_on:
      - koha_mysql
    build:
      context: "koha-docker"
      dockerfile: Dockerfile
      args:
        KOHA_RELEASE: "$KOHA_RELEASE"
    cap_add:
      - SYS_NICE
      - DAC_READ_SEARCH
      - MKNOD
    environment:
      - VIRTUAL_NETWORK=nginx-proxy
      - VIRTUAL_PORT=8080
      - VIRTUAL_HOST=bib.my-website.net
      - LETSENCRYPT_HOST=bib.my-website.net
      - LETSENCRYPT_EMAIL=admin@my-website.net
      - KOHA_ADMINPASS=secret
      - KOHA_ADMINUSER=admin
      - KOHA_INSTANCE=name
      - KOHA_DBHOST=koha_mysql
      - ENABLE_MYSQL_TRIGGERS=True
      - ENABLE_MYSQL_SCHEMA  =True
      #- INSTALL_LANGUAGES=de-DE
      - DEFAULT_LANGUAGE=en
      - EMAIL_ENABLED=True
      - APACHE_MINSERVERS=5
      - APACHE_TIMEOUT=300
      - APACHE_SERVER_STATUS_NET=127.0.0.1/24
      - APACHE_REMOTE_INTERNAL_PROXY=127.0.0.0/16
      - PLACK_MAX_REQUESTS=100
      - PLACK_WORKERS=2
      - AUTHOR_NAME="john_doe"
      - AUTHOR_EMAIL="john@doe.com"
      - ILLENABLE=0
      - ILLUSER=illuser
      - ILLNAME=Interlibrary loan
      #- SIP_AUTOPASS1=autopass
      #- SIP_WORKERS=3
    volumes:
      - 'koha_index:/var/lib/koha/index'
      - 'koha_state:/var/lib/state'

  koha_mysql:
    container_name: koha_mysql
    image: mysql:5.6.20
    networks:
      - proxy-net
    cap_add:
      - MKNOD
    command:
      - mysqld
      - "--datadir=/var/lib/mysql"
      - "--user=mysql"
      - "--max_allowed_packet=64M"
      - "--wait_timeout=6000"
      - "--bind-address=0.0.0.0"
    environment:
      - MYSQL_DATABASE=koha_name
      - MYSQL_PASSWORD=secret
      - MYSQL_ROOT_PASSWORD=secret
      - MYSQL_USER=admin
    volumes:
      - 'koha_mysql_data:/var/lib/mysql'
    logging:
      driver: "json-file"
      options:
        max-size: "1m"
        max-file: "2"

ENCRYPT_EMAIL=mdm@my-website.net

volumes:
  mariadb_data:
    driver: local
  moodle_data:
    driver: local
  nextclouddb_data:
    driver: local
  nextcloud:
    driver: local
  nextcloud_apps:
    driver: local
  nextcloud_config:
    driver: local
  nextcloud_data:
    driver: local
  document_data:
    driver: local
  document_log:
    driver: local
  koha_mysql_data:
    driver: local
  koha_index:
    driver: local
  koha_state:
    driver: local

networks:
  proxy-net:
    driver: bridge
    ipam:
      driver: default
      config:
       - subnet: 172.20.0.0/16
         gateway: 172.20.0.1