I tried for several days to host lemmy 0.17.4 using the docker install instructions, but I was less than successful. The instructions seemed to be riddled with mistakes and and the docker-compose.yml file had some errors. I eventually mostly got it up and running, but I could never access the site through the nginx container. I had to add the lemmy-ui to the external network and expose 80 and 443, and then I could access the UI. But it seemed that the UI was unable to communicate with the DB. And I had to comment out all of the loggers in docker-compose.yml, because I they were giving me errors.
Anyway, I thought I would give it another shot now that 0.18 has been released and the instructions have been updated. It seems to be much better! I was able to almost get it up and running on my first try. However, there is one error. The nginx container failed to start. There is a file it is trying to mount, but the file doesn’t exist. And the instructions don’t seem to say anything about creating that file or where to download it.
Any help would be much appreciated!
The instructions I am following: https://join-lemmy.org/docs/administration/install_docker.html
The error:
Creating lemmy_proxy_1 ... error
ERROR: for lemmy_proxy_1 Cannot start service proxy: crun: mount `<path>/lemmy/nginx_internal.conf` to `etc/nginx/nginx.conf`: Not a directory: OCI runtime error
ERROR: for proxy Cannot start service proxy: crun: mount `<path>/lemmy/nginx_internal.conf` to `etc/nginx/nginx.conf`: Not a directory: OCI runtime error
ERROR: Encountered errors while bringing up the project.
Edit
I ended up finding the file in the lemmy-ansible github project here: https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/nginx_internal.conf
It all comes up now, and I can access it from outside the server. Though, it is http only, even though I have https set to true in docker-compose.yml. And when I try to do the admin sign up, I get the error: SyntaxError: Unexpected token 'O', "Origin is "... is not valid JSON
Edit 2
It’s all working now. I’m not sure exactly what I did. I set up my https cert by modifying the nginx_internal.conf and adding ssl details, and now it all works. 🤷
Thanks for the replies!
Try Lemmy-Easy-Deploy
https://github.com/ubergeek77/Lemmy-Easy-Deploy
It worked great for getting my instance up and going. You can set the version you want as well if you prefer 17.4 over 18
deleted by creator
It’s literally pulling the docker images. The good thing about it being open source, is you can see the script it runs and figure it out with the tiniest bit of work and research.
deleted by creator
Eh that’s a bridge people will cross then.
You need to change the line starting <path> in your docker compose file and make sure it reflects where the nginx internal config file actually is.
Mine is in the same folder as the compose file, so it’s ./nginx_internal.conf:/etc/nginx/nginx.conf
well, you didn’t create and populate the nginx.conf in the same directory where docker-compose.yaml is located?
The instructions didn’t tell me I needed to. I don’t know how someone is supposed to know that. I would have expected the instructions to at very least tell me I needed to make that and what the file name should be. But I did eventually figure it out. I had to search their github page to find the example one, then modify it for https
Yeah the instructions are terrible.
If you’d like to host on fly.io, I wrote some scripts to try to make it easier:
I set mine up with the 0.17.4 and got it working, but like you wrote the the instructions have changed, all the detail is gone so I can only guess. Are there any volume statements in the new (v. 0.18) docker-compose.yml for the proxy container which would point to a local file? Mine has got this:
volumes: - ./nginx.conf:/etc/nginx/nginx.conf:ro
and I had to set up the local nginx.conf file.
edit: I just had a similar conversation in the Lemmy Matrix channel, it looks like the official documentation for some reason doesn’t specify the content of the nginx_internal.conf file any longer. After adding the v. 0.17 nginx content to this file that instance was working.
I assume there is a <path> inside the compose file that you have to replace with an actual path?
Oh, that was my bad. I replaced my actual path with <path> because my name is in the path (home directory). Sorry, I definitely should have clarified that.