erseco / alpine-moodle

Moodle docker image based on Alpine Linux
https://hub.docker.com/r/erseco/alpine-moodle
MIT License
42 stars 33 forks source link

docker-compose up - it does not work #7

Closed mricim closed 2 years ago

mricim commented 3 years ago

When I use "docker-compose up" I get this error:

Creating moodle_postgres_1 ... done
Creating moodle_moodle_1   ... done
Attaching to moodle_postgres_1, moodle_moodle_1
moodle_1    | Starting startup scripts in /docker-entrypoint-init.d ...
moodle_1    | *** Running: /docker-entrypoint-init.d/01-uname.sh
moodle_1    | Linux d088128cf857 5.10.60-v7+ #1449 SMP Wed Aug 25 15:00:01 BST 2021 armv7l Linux
moodle_1    | *** Running: /docker-entrypoint-init.d/02-configure-moodle.sh
moodle_1    | Waiting for : to be ready
postgres_1  |
postgres_1  | PostgreSQL Database directory appears to contain a database; Skipping initialization
postgres_1  |
postgres_1  | 2021-09-21 20:39:02.545 UTC [1] LOG:  starting PostgreSQL 13.4 on arm-unknown-linux-musleabihf, compiled by gcc (Alpine 10.3.1_git20210424) 10.3.1 20210424, 32-bit
postgres_1  | 2021-09-21 20:39:02.546 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
postgres_1  | 2021-09-21 20:39:02.546 UTC [1] LOG:  listening on IPv6 address "::", port 5432
postgres_1  | 2021-09-21 20:39:02.558 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
moodle_1    |  is ready
postgres_1  | 2021-09-21 20:39:02.598 UTC [21] LOG:  database system was shut down at 2021-09-21 20:33:43 UTC
postgres_1  | 2021-09-21 20:39:02.686 UTC [1] LOG:  database system is ready to accept connections
moodle_1    | Generating config.php file...
moodle_1    |                                  .-..-.
moodle_1    |    _____                         | || |
moodle_1    |   /____/-.---_  .---.  .---.  .-.| || | .---.
moodle_1    |   | |  _   _  |/  _  \/  _  \/  _  || |/  __ \
moodle_1    |   * | | | | | || |_| || |_| || |_| || || |___/
moodle_1    |     |_| |_| |_|\_____/\_____/\_____||_|\_____)
moodle_1    |
moodle_1    | Moodle 3.11.3+ (Build: 20210917) command line installation program
moodle_1    | Skipping database installation.
moodle_1    | Installation completed successfully.
moodle_1    | Upgrading moodle...
moodle_1    | == Maintenance mode (http://xxxxx.com) ==
moodle_1    | Your site is currently in CLI maintenance mode, no web access is allowed.
moodle_1    | Config table does not contain the version. You cannot continue.
moodle_1    |
moodle_1    | *** Failed with return value: 0
moodle_1    | Upgrading moodle...
moodle_1    | == Maintenance mode (http://xxxxx.com) ==
moodle_1    | Your site is currently in CLI maintenance mode, no web access is allowed.
moodle_1    | Config table does not contain the version. You cannot continue.
moodle_1    |
moodle_1    | *** Failed with return value: 0
moodle_moodle_1 exited with code 1

Is there something that I have left or is something really not working?

lupa18 commented 3 years ago

Hi @mricim !

Did you double checked environment variables at docker-compose.yml ?

mricim commented 3 years ago

Hi @lupa18 !

I think so, just modify "SITE_URL" and the rest is by default. Do I have to check something else?

lupa18 commented 3 years ago

Yes, I changed a lot, but you're right, that should be enough (did you masked real URL for post it here, right?).

Error seems to be: "Config table does not contain the version".

Did you tried to delete container, volumes and up again?

mricim commented 3 years ago

Yes, I did everything clean, I even tried to use "docker-compose up --build" and it doesn't work either. In one of the moodle tests I was trying to update and it threw an error saying that it needed a version higher than 3.6, maybe it's something else.

erseco commented 2 years ago

Hello, if you set a SITE_URL, moodle will try to load from there, so you need to expose the container to that URL, if you want to trick this you should use a proxy as Nginx in the front or something like traefik, try to explain your needs and I will try to help you with the configuration.

Best regards!

mricim commented 2 years ago

Hi @erseco , I wanted to use moodle in an rpi3b+, modify only that parameter and it throws me that error. Don't modify anything else, I don't want to put it behind anything. I can't really give you more information as I don't think I have anything else to give you. I can do the tests and deliver the logs that you consider if you need it

erseco commented 2 years ago

Ok, but after installing moodle in your raspberry, how do you want to access the installed moodle? Using a custom domain name? Using the raspberry IP address? Is important to configure it properly.

Best!

mricim commented 2 years ago

I use my own domain name. I have used it before with both nginx and apache and it has worked perfectly for me. I have also tried using the ip internally. The moodle installation screen appears in both cases, but it gives an error when installing it (conf missing and error with the db)

erseco commented 2 years ago

In that case you must point the domain address in your raspberry's /etc/hosts file

For example, if your domain is example.com add a line to that file like this

127.0.0.1       example.com