Issue with the port mapping in the Dockerfile

Hello, it seems that I cannot use port 80 anymore, but instead port 8080 when mapping ports in docker. I think it’s because the ENTRYPOINT command was changed in the Dockerfile with this commit: fix bug where image cannot receive commands (load, help) · moqui/moqui-framework@cc8b7c9 · GitHub

@taher does port 80 still work for you when running Moqui inside docker? Why did you make that change?

Hi @grozadanut.

I simply removed port 80 from ENTRYPOINT and added it to CMD as a default, and also added it to the compose files as a default command: conf=conf/MoquiProductionConf.xml port=80. In other words ports did not change anywhere. Maybe you already have some service running on the machine and occupying port 80?

The reason I made the change is to give more flexibility to starting the docker container. Moqui server can start in 3 ways from MoquiStart.java: help, load or with no / other args for a normal start. This means you can use the same docker image for both loading and starting the server, which makes the CI workflow simpler and cleaner. Below is an example of something you could not do before but is possible now:

docker compose -f moqui-postgres-compose.yml run --rm moqui-server load conf="conf/MoquiProductionConf" types="seed,seed-initial,install,whatever"

You can even change the inner port (not bounded one) which was not possible in the past. Simply change in the compose file command: or from the docker cli directly.

Indeed, I haven’t noticed that the ‘command:’ line inside the compose files changed. And I run Moqui using a custom yml compose file, so that one was not updated. I’ll test it Monday and report back the result. Should work with the change I guess.

Unless you have a good reason, I would recommend using one of the existing yaml files. They have everything you need, and even if you decided you want additional services or whatever, then it’s better to just do something like -f one.yml -f two.yml. There is also a new README.md in the docker directory describing how to use the stuff inside. You can “override” instead of using a separate yaml file.

Yea, indeed I had to modify the following line and now it works:

command: conf=conf/MoquiProductionConf.xml port=80

As for the reason for using a custom compose file, it’s because I need only the moqui container, as the postgres dabatase and the reverse proxy(traefik) are externally managed.