-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Official Docker container at Docker hub #26
Comments
Thanks for opening the issue alex, At the moment I'm working very actively on the product itself. I haven't made it easy to self-host because it's a lot of work and it would slow down development. Adding documentation for self-hosting and a Docker image is something I can see happening in the future but but I'm not going to address it immediately. Hope you understand. |
Hi Uku, awesome, thank you for your fast response! |
@alexanderadam It is fairly easy to run the app locally if you have node and Elixir installed. It's based on my setup (I prefer to run database via docker and Elixir/Node apps locally). Here's a rough step-by-step:
If everything went well, you should be able to access the app via http://localhost:8000. Although keep in mind that as Uku mentioned, there's more to just starting the app locally. You'll need to dig a bit into the code to configure other aspects like e.g. email, landing page, trial, etc. But that should also get you going and set up for exploration :-) |
Thank you for responding @tjomk, I agree that this is fine for a development setup but a Docker container is obviously much easier for other environments. A properly tagged image allows easy rollbacks and updates. Also it wouldn't require to have all of the build dependencies locally available. These are some reasons why other analytics alternatives can simply be tested/installed with a simple |
Yeah, it's not easy to get this app running in Docker. Appears to ignore the environment variables during runtime. Only way to get it working is not to go for mix release and then run the release but get all the dependencies, build, at first start of the docker image. |
I have made a pull request #53 which will introduce a docker-compose script which runs the development build. It's a start... |
I am also made some changes here to make production build working: https://github.com/weyert/plausible/tree/production-release-docker If anyone wanna try and help make it fully help that would be amazing. It's based on the Google Cloud dockerfile example |
Any feedback @ukutaht? |
@alexanderadam / @ukutaht / @weyert As I have mentioned in #53 (comment) I have a fork with "docker" ready configuration. Fork: https://gitlab.com/tckb-public/plausible It still needs a read-me description. I will add it in coming days. I plan to maintain this, ofcourse for my own personal use. @ukutaht When you have time, please do check it, I can create a PR to push in my changes. |
@tckb I like the changes you did. It looks well-thought-out! 👍 Just one question: why did you switch away from the |
@alexanderadam I've had https://gitlab.com/tckb-public/plausible/-/jobs/541156725#L2093 problem. Normally, this is usually due to missing packages in the base distro. This is why I avoid using the "slim" versions. A reason why I moved away from alpine based images. This would be apparent when I add the image scanning stage (will do it in the coming days). All in all, non-slim version is still at ~ 100Mb (the latest one is at 105.85 MiB). |
Wasn't this rather solved because you added the line that installed webpack in the same commit? 🤔 |
@alexanderadam I haven't checked with just the installing ;) I did the changes together. I will check and add different images once I have all the other changes ready. I would want to make few more changes before I officially open a PR, namely:
there are more. I will add it once I have the changes in place |
@tckb These changes would be awesome and welcome. I'm super happy to review stuff and merge upstream. I will make an effort to be more active in this discussion as well to help as much as I can with the time I can dedicate to this. Here are some more things to think about when it comes to self-hosting:
Some of these are not necessary for the first 'proof of concept' release but I just wrote a brain-dump of what I can think of at the moment. |
@ukutaht glad to hear that you are on-board :) I addressed some of the items you pointed out, but it will super helpful if you can help me in right direction, especially in pointing out the hardcoded items.
I tried to address some of the issues below there are other items that I am working on here: https://gitlab.com/tckb-public/plausible/-/issues?scope=all&sort=created_date&state=all&utf8=%E2%9C%93 I added a readme of hosting documentation. . |
@ukutaht @alexanderadam @weyert |
Excited to see this going and hopefully out soon! I have one question, how the update is being handled? One way that I saw in another project is to have a docker.sh script with three functions, |
I don't have much experience with this so I'm lookg to @tckb and others for guidance. We can potentially run any needed migrations when Docker boots, so an upgrade would just be pulling a new Docker image and running it. The new version would migrate the data volumes to the necessary state and boot the server. Not sure if that could work? |
@Kulcanhez as I see, there's no "Self-update" (i.e., update to next stable version etc) process in place and I am not sure if this even make sense. The idea is that the latest version will be pushed to docker hub and you can use the sample a migration of db is already pre-cooked into the docker image, as a example in the sample docker-compose, the db migration is executed on first run. https://github.com/tckb/plausible/blob/master/docker-compose.yml#L37 Hope that helps 👍 |
Yeah, massive thanks to @tckb for the work done so far. We're quite close to having it ready for testing. I'm working on the codebase to decouple it from my current hosting setup so it works with the Docker setup. Today I'm integrating Oban for background job processing so the scheduling is done by the app itself. I also need to integrate MaxMind's GeoIP database so we're not relying on an external CDN to get visitor location information. AFAIK, @tckb is looking at migrations with Clickhouse. Currently, I'm managing the schema manually which is not ideal for a self-hosted solution. There's also work to integrate it with my Travis setup and push images to DockerHub. My goal is to have a public alpha ready for people to test by the end of next week. Would you be interested in running and testing it? |
@ukutaht absolutely, keep me updated!! 😃 Yesterday came to my mind that it would be nice for the self-hosted solutions to have a little reminder in the dashboard saying something like "If you love this project consider supporting it." so people don't forget it. 😋 |
@Kulcanhez since clickhouse library isn't supported by ecto, there's no ecto migration but, I have added the necessary steps for migration in existing migration steps. the database migration takes care of both clickhouse and postgres. There should be a possibility of using clickhouse_ecto in the next releases. Once Oban is added, I will add this to the migrations as well. @ukutaht would it posssible to add me to the PR ? I would want to create some more changes on my end |
Hi folks,
thank you so much for your work. 🙏
I just thought it would be nice to have an official 🐋 Docker container for easier trying out plausible on a local machine or server.
See also
nolt.io
issue 56.The text was updated successfully, but these errors were encountered: