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

Add Docker support #22

Open
nandedamana opened this issue Oct 25, 2022 · 3 comments
Open

Add Docker support #22

nandedamana opened this issue Oct 25, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@nandedamana
Copy link

The current codebase requires the user to set up and link a Postgres instance manually. The time and effort required for this would cause many people not to give dictpress a try. Of course one could use Docker themselves, but providing a basic docker-compose file would still be useful and attractive, I believe.

Here's a basic Docker Compose support (just for the DB) that I added to try out dictpress for the first time:
https://github.com/nandedamana/dictpress/tree/add-docker-support

It also contains an option to auto-generate the postgres password env file and sync it with config.toml. However, I'm not satisfied with the changes, and that's why I'm not filing a PR now.

There are multiple things in the current state of the branch that might be frowned upon, including:

  • The added docker support is partial (just for DB, not the server itself)
  • Placeholder DB name and username changed to "postgres" in config.sample.toml
  • Generation of pg.secret.env and its syncing with config.toml is written in the Go program itself, rather than in a shell script or something

Please share your thoughts.

@knadh
Copy link
Owner

knadh commented Oct 27, 2022

Thanks @nandedamana. I think we can copy https://github.com/knadh/listmonk/blob/master/docker-compose.yml almost as-is. listmonk and dictpress as very similar in their startup/setup/DB behaviour. Just haven't had a chance to port it to dictpress and test. If you're able to, please feel free to send a PR.

@knadh knadh added the enhancement New feature or request label Oct 27, 2022
@subins2000
Copy link
Collaborator

@asdofindia had made a Dockerfile, ping ping

@asdofindia
Copy link
Contributor

Made a docker compose based setup in https://gitlab.com/smc/samam/-/blob/master/dictpress/docker/docker-compose.yml - but the goal there was to be able to recreate the whole site from scratch. It works nevertheless.

What I do observe, though, is that

  1. Dictpress is a single binary. So not much advantage in building a docker image with that and running that.
  2. The configurations are pretty much core to the whole setup. Unless it is for a demo site, there's no way to predict how to configure the dictpress
  3. One might or might not have data to import.

So, eventually, for the above project we just stopped using docker.

I think the scope of what docker (or docker compose) should be doing should be made clear. If it is for someone who doesn't want to touch their system postgres, we could document 1) how to create a new postgres cluster, or 2) how to run postgres via docker run

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

No branches or pull requests

4 participants