-
-
Notifications
You must be signed in to change notification settings - Fork 81
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 image to make it even easier to distribute Phanpy #466
base: main
Are you sure you want to change the base?
Conversation
@AlyxPink thanks! 9MB looks really good. Few things:
|
hmm just noticed this https://github.com/burntcookie90/phanpy-dockerfile by @burntcookie90 |
ππΎ I have the basest of understanding of what I'm doing and the deployed image is not as small as I'd like for an official release. However, I have been using this deployed image since I made it without issue, so its a good example of it working. |
There are (at least) two different cases for running phanpy in Docker:
Ad 1: I think that a Docker image should be clear about which it is aiming for. Might even discourage running on I like @burntcookie90's approach of building phanpy and I've done similar: Since it's Docker, we can take advantage of being able to build Phanpy ( My image (for running on `localhost`) looks like this
|
- The build now happens in the container itself, uisng node:20-alpine as the build stage - A special artifacts stage is created (but won't be used unless specifically called) to create the archive files, used as the releases - Switched from httpd to nginx The image is still very light (16.9MB)
- As the build now happens inside the container, I thought it was a good idea to extract it from the image instead of rebuilding it on the host - QEMU and Buildx are just stuff for multiplatform builds (even if it's just a bunch of static files, I don't think docker is able to detect that the base image (nginx) exists in multiplatform, I might be wrong - Add actions to extract metadata in order to tag the image - Add actions to logins to Docker Hub and GitHub Registry - Build and push to both registry, with our previously created tags - Build only, locally, the "artifacts" stage, where we can extract the zip files. As it's reusing the previous stages, it won't be build twice. - Extract the artifacts so the previous release workflow can keep on going (as it should!)
Hey there! Thanks for your replies π
I thought it would be better to have a well known web server, so I moved to nginx. It's still very light (16.9MB) anyway.
I understand from what I've seen on #501 that you are not sure if you want to take ownership of the Docker image. I can totally understand not wanting to be responsible for a tool that you are not used to. I'm available if you need any help, discussion (a call, emails, etc) or if you want me to own this piece, I'll do my best to be as responsive as I can in case something goes wrong. My opinion on letting other people create their own image is that there won't be a "safe" or "official" one and that could scare some away. Once the build flow is working, with so few dependencies, I don't think it could break easily, and so it would be pretty stable and easy to maintain. Regarding the "custom build" parameters, I'll investigate what it is and how we could make it a work with our Dockerfile. I'll document that part too. Also now there are two conversations about the same thing, if you want to close a PR in favor of another, let me know, we could collaborate on the same one with @yitsushi π @burntcookie90 good job π Just to get an opinion, would you rather keep using your own build or you'd prefer having an official one? @benjaoming Hm good idea, I don't have the knowledge to be 100% sure it could happen, but it seems totally plausible. Maybe we could ship the image with a configuration that make sure you can't access the app from localhost π€ Or at least not without an explicit warning. I wonder if other applications are doing something special for that case. Yes, I think it's the way. If Phanpy adopts having an official Docker container image, then I think the build should happen in the same place. Any reason you are cloning the whole repo and checking out at a specific tag, instead of either using |
Created a Discussion, I think that's more easier to follow and fits more: #511 |
Hey there! Thank you for your amazing client, I fell in love π»
I thought it might be a good idea to β on top of GitHub releases β create a Docker container to easily deploy the project. As it's quite common to just slap a container on a server and call it a day. For some, including me, it's much easier to do so than deploying static files, as everything is running inside Docker container.
So I drafted really quickly a POC for a Dockerfile, to get your opinion on this. I will work on the CI/CD part if you think it's a good thing to add, and refine how the environment variables will work.
If you are worried by the size of the Docker image created, no worries, it's very light:
Happy to help with anything, and of course, if it's not something you want to invest time in, either I could help to maintain this part, or the PR can be closed. I know accepting PR means having more things to maintain, so no worries.
I hope your Monday will be good π