Skip to content
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.yml linked for manual docker install contain ansible if-statements #274

Open
Sakrecoer opened this issue Oct 4, 2023 · 6 comments

Comments

@Sakrecoer
Copy link

Sakrecoer commented Oct 4, 2023

This page list the docker-compose.yml for to download with wget. Since it contains a bunch of if statements to define the lemmy environment variables, docker compose up -d chokes on them.

$ docker compose up -d
parsing /opt/lemmy/docker-compose.yml: yaml: line 32: found character that cannot start any token
@Nutomic
Copy link
Member

Nutomic commented Oct 4, 2023

cc @codyro @ticoombs

@dessalines
Copy link
Member

I see that... the problem is that docker-compose.yml now has those conditional template blocks. Not sure if there's a good way to resolve that without having separate docker-compose files, which I really don't want to do.

@codyro
Copy link
Contributor

codyro commented Oct 4, 2023

Here are a few quick thoughts on some options--none of which I'm in love with:

  • The page already mentions removing Ansible-specific verbiage when downloading it directly--we could expand on that and mention you need to remove the Ansible/Jinja2-specific {% %} blocks as well.

  • We can reconsider utilizing env files again, which should work around this as the Ansible-specific conditionals would be in those instead of the docker-compose.yml file.

  • We can maintain multiple copies of the docker-compose.yml file, but as @dessalines noted, that's less than ideal.

  • We can provide snippets to strip the Ansible-specific blocks using sed/awk/something.

@dessalines
Copy link
Member

I'd vote for option 4 (same as option 1, but we give them the remove command), as long as there's nothing vital in those conditional blocks.

@Nutomic
Copy link
Member

Nutomic commented Oct 5, 2023

I still dont really see whats the advantage of using vars.yml over .env so I would simply switch to the latter.

@ticoombs
Copy link

ticoombs commented Oct 9, 2023

whats the advantage of using vars.yml over .env

FWIW, there isn't really. Ansible (generally speaking) is yaml with jinja templating. As such the files are yaml based. .env does not really make sense unless the environment variables were for the apps inside (ie; if we created .env files for lemmy/lemmy-ui/etc). because it would still be yaml inside the .env file if we needed to import it for ansible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants