SOLUTION:
The issue was - the ‘New UI’ docker image was automatically building for AMD64, but the Linux server is an ARM64/v8.
I had to add QEMU and multi-platform build commands to the docker-image.yml file (in Github Actions).
This creates an additional docker image for ARM64 machines, which loads and runs successfully.
This was discovered by manually building a docker container, and receiving the following message:
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
So if you get that message, you must build your docker image for the platform you are on (or multiple platforms).
** == ** == ** == ** == ** == ** == **
ORIGINAL ERROR:
THE SETUP and ERROR
- I made a fresh ansible install, on a fresh ubuntu 20.04 server - the Lemmy instance runs perfectly.
- I made a fresh fork of the 16.7 Lemmy-UI.
- I built a docker-image of that forked UI, and loaded it via docker-compose (here is my docker-image.yml build file ).
Now I am getting a “502 Bad Gateway - nginx” error (the site does not load).
NGINX error log shows:
connect() failed (111: Connection refused) while connecting to upstream, client: 75.222.232.212, server: ggg.com, request: "GET / HTTP/2.0", upstream: "http://0.0.0.0:15153/", host: "ggg.com"
-
Nginx config has not been modified (but here is the config anyway - ggg.conf)
-
Docker log is clean.
**
DIAGNOSIS
When I list docker containers, there is no PORT mapped to the ‘New-UI’ image container.
(However, when running the ‘default lemmy-UI’ image container, the PORT is successfully mapped to 127.0.0.1:15153->1234/tcp)
It seems I must create a new Container, using the ‘New-UI’ image, and map the PORT to 127.0.0.1:15153->1234/tcp (unless an Environment Variable can do it).
^ Now I must figure out that exact docker command. (because docker run -d -p 127.0.0.1:15153:1234 [ImageID]
does not successfully create the container.)
**
Here are the Env Vars I’ve added (in various combinations/values):
lemmy-ui:
environment:
- LEMMY_UI_HTTPS=true
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
- LEMMY_UI_LEMMY_EXTERNAL_HOST=ggg.com
- LEMMY_UI_DISABLE_CSP=true
# - LEMMY_UI_LEMMY_WS_HOST=lemmy:8536
# - LEMMY_UI_HOST=0.0.0.0:1234
here is the full docker-compose.yml (only changed Env Vars)
1 - I’ve completed your suggestions.
You are correct - I had forked the ‘Main’ branch, which runs a different
js-client
than UI-16.7.So I merged 16.7 into my fork… and everything WORKS.
Thank you - that was helpful.
[I also set up Drone. Yes, it builds very fast.]
**
2 - Perhaps “LEMMY_DATABASE_URL” shows an obsolete value in the config docs:
postgres://lemmy:pw@LEMMY_DB:5432/lemmy
postgres://lemmy:pw@POSTGRES:5432/lemmy
That 2nd string worked for me anyway - on an ansible install. (the former gives a 404 fetch error).
**
Thank you very much again.
Lemmy is running smooth and looking great.
I hope you are doing alright.