simplerisk / docker

SimpleRisk Docker Repository
https://www.simplerisk.com
Mozilla Public License 2.0
26 stars 20 forks source link

The container can't be started by using the new image #29

Closed jfucanada closed 3 years ago

jfucanada commented 3 years ago

version: '3'

services: simplerisktest: image: phsa-simplerisknew:v1.0 hostname: risktest

ports:

- 80:80

- 443:443

 volumes:
   - "./bashrc:/root/.bashrc:rw"
   - "html:/var/www/simplerisk:rw"
   - "html-etc-ssl:/etc/apache2/ssl:rw"
   - "mysql-data:/var/lib/mysql:rw"
   - "mysql-etc:/etc/mysql:rw"
   - "var-log:/var/log:rw"
   - "config:/configurations:rw"
   - "pw:/passwords:rw"
   - /etc/localtime:/etc/localtime:ro

phpmyadmintest: image: phpmyadmin/phpmyadmin container_name: phpmyadmintest environment:

volumes: html: html-etc-ssl: mysql-data: mysql-etc: var-log: config: pw:

jsokol commented 3 years ago

Hello. Your issue doesn't really provide us with any information about how this Docker was created or what you're trying to do. None of our images use phpmyadmin so I'm assuming this is something that you created and we can't support that. Our official Docker instructions can be found at https://www.simplerisk.com/download by selecting "Install SimpleRisk as a Docker container". I just followed those instructions and it installed the current 20210802-001 release of SimpleRisk with a fully passing health check without any issues. I'm going to close this, but if you need additional assistance with a SimpleRisk instance, I'd ask that you please contact support (at) simplerisk (dot) com. Thank you.

jfucanada commented 3 years ago

Thanks for the feedback.

After I modified the entrypoint script as below and remake the image, I am able to restart container without the issue.

set_config(){

If MySQL hasn't already been configured

if [ ! -f /configurations/mysql-configured ]; then
CONFIG_PATH='/var/www/simplerisk/includes/config.php'

SIMPLERISK_DB_HOSTNAME=localhost && sed -i "s/\('DB_HOSTNAME', '\).*\(');\)/\1$SIMPLERISK_DB_HOSTNAME\2/g" $CONFIG_PATH
SIMPLERISK_DB_PORT=3306 && sed -i "s/\('DB_PORT', '\).*\(');\)/\1$SIMPLERISK_DB_PORT\2/g" $CONFIG_PATH
SIMPLERISK_DB_USERNAME=simplerisk && sed -i "s/\('DB_USERNAME', '\).*\(');\)/\1$SIMPLERISK_DB_USERNAME\2/g" $CONFIG_PATH
set_db_password
SIMPLERISK_DB_DATABASE=simplerisk && sed -i "s/\('DB_DATABASE', '\).*\(');\)/\1$SIMPLERISK_DB_DATABASE\2/g" $CONFIG_PATH
# shellcheck disable=SC2015
[ "$(cat /tmp/version)" == "testing" ] && sed -i "s|//\(define('.*_URL\)|\1|g" $CONFIG_PATH || true
fi

}