-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker-compose conflict with nginx in :80 and :443 port #163
Comments
Ever since @sam365724 correctly created a sandboxed version of our dev and prod dockerfiles, we have yet to add a simple nginx reverse proxy that works with it. Its really as simple as:
|
@dessalines I'm having this same issue. Can I get a bit more clear of an answer about how to fix it? I'm using this config and cannot seem to get it to work. Turning off nginx during docker-compose doesn't fix it either, as I just end up with a 502 gateway error. |
@ahribellah How did you install lemmy? Post the rest of your config files. |
I installed through Docker. I'm having issues now because Docker is doing this (apparently common) thing where it's binding nginx.conf as a folder and erroring out when building the container. My attempts to fix that are resulting in empty files and I don't have a lot of experience with Docker, so I'm not 100% sure whether it will actually work afterwards. It's probably my fault, as I tried stripping out the proxy manually and then rebuilt normally afterwards, but clearing the cache hasn't helped. Either way, I got around it by using the command I deliberately used Anyways, here are my actual configs with sensitive info stripped out. docker-compose.yml: version: "3.3"
networks:
# communication to web and clients
lemmyexternalproxy:
# communication between lemmy services
lemmyinternal:
driver: bridge
internal: true
services:
proxy:
image: nginx:1-alpine
networks:
- lemmyinternal
- lemmyexternalproxy
ports:
# only ports facing any connection from outside
- 80:80
- 443:443
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
# setup your certbot and letsencrypt config
- ./certbot:/var/www/certbot
- ./letsencrypt:/etc/letsencrypt/live
restart: always
depends_on:
- pictrs
- lemmy-ui
lemmy:
image: dessalines/lemmy:0.17.2
hostname: lemmy
networks:
- lemmyinternal
restart: always
environment:
- RUST_LOG="warn,lemmy_server=info,lemmy_api=info,lemmy_api_common=info,lemmy_api_crud=info,lemmy_apub=info,lemmy_db_schema=info,lemmy_db_views=info,lemmy_db_views_actor=info,lemmy_db_views_moderator=info,lemmy_routes=info,lemmy_utils=info,lemmy_websocket=info"
volumes:
- ./lemmy.hjson:/config/config.hjson
depends_on:
- postgres
- pictrs
lemmy-ui:
image: dessalines/lemmy-ui:0.17.2
networks:
- lemmyinternal
environment:
# this needs to match the hostname defined in the lemmy service
- LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536
# set the outside hostname here
- LEMMY_UI_LEMMY_EXTERNAL_HOST=my.domain.com
- LEMMY_UI_HTTPS=true
- LEMMY_HTTPS=true
depends_on:
- lemmy
restart: always
pictrs:
image: asonix/pictrs:0.3.1
# this needs to match the pictrs url in lemmy.hjson
hostname: pictrs
# we can set options to pictrs like this, here we set max. image size and forced format for conversion
# entrypoint: /sbin/tini -- /usr/local/bin/pict-rs -p /mnt -m 4 --image-format webp
networks:
- lemmyinternal
environment:
- PICTRS__API_KEY=API_KEY
user: 991:991
volumes:
- ./volumes/pictrs:/mnt
restart: always
postgres:
image: postgres:15-alpine
# this needs to match the database host in lemmy.hson
hostname: postgres
networks:
- lemmyinternal
environment:
- POSTGRES_USER=lemmy
- POSTGRES_PASSWORD=password
- POSTGRES_DB=lemmy
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always lemmy.hjson (I don't remember where I saw to add
lemmy.conf (under
EDIT: Ah, right, this one error shows when I run
However, it's then followed by successful PostgreSQL init and startup, so I've attributed that to the database not being initialized and online when it attempts to connect, as it ends with the following loine:
|
Your server nginx only needs to be the one referenced in this comment I apologize our docs aren't updated to account for this. |
When i install new version from docker, with Kradyz guide - i have this problem with compose.
nutomic told me create this isssues :)
nutomic
there was an nginx service added to the docker-compose, i missed that at the time. should either be reverted or needs to be included in upgrade notes.
The text was updated successfully, but these errors were encountered: