I’m not exactly a linux beginner but I’m far from an expert and I could use some pointers. I have a domain and a VPS through Namecheap, I chose Ubuntu 20.04 LAMP and I’ve tried several guides to get this working but something always goes wrong sooner or later.
My latest attempt is to follow along with this guide: https://join-lemmy.org/docs/administration/install_docker.html
No errors until the docker-compose up -d command, then
ERROR: yaml.constructor.ConstructorError: while constructing a mapping in “./docker-compose.yml”, line 26, column 12 found unhashable key in “./docker-compose.yml”, line 26, column 13
which leads to image: {{ lemmy_docker_image }}
I guess I could start over with a different guide but I’m just chasing my tail at this point. Could any kind soul suggest where to go from here?
Hi there! This sounds like you might just have a typo in your docker-compose.yml file. It might be helpful if you posted your docker-compose.yml contents here (be sure to remove any sensitive information).
Line 26 of my docker-compose.yml file is the volume block/map for letsencrypt. Did you perhaps mix tabs and spaces, or have one too many spaces in your indentations, in your yaml file? That’s a no-no…
Personally, I setup my instance using the same guide as you, opting for the docker containers. There were definitely a few pitfalls to deal with.
Here you go! There shouldn’t be any sensitive info in there, I haven’t modified it. The command in the instructions:
wget https://raw.githubusercontent.com/LemmyNet/lemmy-ansible/main/templates/docker-compose.yml
obtained the file and there’s no instruction to modify it prior to running docker-compose up -d which is where it fails.
version: “3.7”
x-logging: &default-logging driver: “json-file” options: max-size: “50m” max-file: “4”
services: proxy: image: nginx:1-alpine ports: # actual and only port facing any connection from outside # Note, change the left number if port 1236 is already in use on your system # You could use port 80 if you won’t use a reverse proxy - “{{ lemmy_port }}:8536” volumes: - ./nginx_internal.conf:/etc/nginx/nginx.conf:ro,Z restart: always logging: *default-logging depends_on: - pictrs - lemmy-ui
lemmy: image: {{ lemmy_docker_image }} hostname: lemmy restart: always logging: *default-logging environment: - RUST_LOG=“warn” volumes: - ./lemmy.hjson:/config/config.hjson:Z depends_on: - postgres - pictrs
lemmy-ui: image: {{ lemmy_docker_ui_image }} environment: - LEMMY_UI_LEMMY_INTERNAL_HOST=lemmy:8536 - LEMMY_UI_LEMMY_EXTERNAL_HOST={{ domain }} - LEMMY_UI_HTTPS=true volumes: - ./volumes/lemmy-ui/extra_themes:/app/extra_themes depends_on: - lemmy restart: always logging: *default-logging
pictrs: image: asonix/pictrs:0.4.0-rc.7 # 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 environment: - PICTRS_OPENTELEMETRY_URL=http://otel:4137 - PICTRS__API_KEY={{ postgres_password }} - RUST_LOG=debug - RUST_BACKTRACE=full - PICTRS__MEDIA__VIDEO_CODEC=vp9 - PICTRS__MEDIA__GIF__MAX_WIDTH=256 - PICTRS__MEDIA__GIF__MAX_HEIGHT=256 - PICTRS__MEDIA__GIF__MAX_AREA=65536 - PICTRS__MEDIA__GIF__MAX_FRAME_COUNT=400 user: 991:991 volumes: - ./volumes/pictrs:/mnt:Z restart: always logging: *default-logging deploy: resources: limits: memory: 690m
postgres: image: postgres:15-alpine hostname: postgres environment: - POSTGRES_USER=lemmy - POSTGRES_PASSWORD={{ postgres_password }} - POSTGRES_DB=lemmy volumes: - ./volumes/postgres:/var/lib/postgresql/data:Z - ./customPostgresql.conf:/etc/postgresql.conf restart: always logging: *default-logging
postfix: image: mwader/postfix-relay environment: - POSTFIX_myhostname={{ domain }} restart: “always” logging: *default-logging
Sorry I didn’t get a chance to look at this, but I’m mostly on mobile and the link doesn’t work.
For future reference you can put it in a code block and lemmy-ui should be able to render it for you.
Example code block