astral
astral copied to clipboard
Add docker files
In response to https://github.com/astralapp/astral/issues/212
Thanks for doing this! Now that I can take a closer look, I have a few questions:
- Is there a reason you chose Apache over Nginx? Myself (and most Laravel services like Homestead, Valet, etc) use Nginx. The production app also uses Nginx, and it might make sense to have them match.
- Is it difficult to set the timezones to just use UTC? I think thats the most generic option for everyone.
- Does the
.env.template
file need to exist, since we already have a.env.example
file in the root?
- Main reason was to use standard php images as a base, and they provide one with apache. My go-to is usually nginx, but i was aiming for simplicity in this proof of concept, rewriting it to use nginx could be doable
- I see you point about timezones, that is my bad, used my personnal templates to do this ^^
- Depending on how the docker files are placed into the project, it might not be usefull. The idea is to have a
.env
file that is read by default by docker, to be able to easly change the configuration, but as you might have seen, the content is the same as the.env
file of the project
@unsync
- Gotcha, if it's too much hassle to switch it to Nginx, don't worry about it.
- All good! I figured as much 😄
- Yeah, would be nice if we could somehow instruct Docker to use the default
.env
in the root. Not a huge deal I suppose, but any time the env gets updated, it's just one more place we need to update which is a bit of a pain.
- you have two use cases (that i can hink of) :
a. using docker for local developement. In that case, using the same
.env
is cool, don't need to modify it in two places b. distributing astral with docker hub. In that case, you start with an empty folder, copy the docker-compose file, copy the template.env.tpl
and that's it.
Not sure if there is a definitive answer to this, it might depend on how you consider distributing astral with docker ?
@unsync I could be totally off the mark but I assumed people who wanted Docker support mostly wanted it as a local dev tool.
That is actually a very good question ! Personally I did this setup thinking about hosting my own astral server... but if this docker setup is aiming at developers, it could be done differently. Having some feedback about this should be interesting !
As originally stated in #212 I think the Docker image should be targeted at users who wish to self-host the application. I'm not too familiar with PHP applications but shouldn't the Docker image this application provides be using PHP-FPM for its entrypoint and allow the user to select the webserver of their choice to reverse proxy to traffic to the application container? Containing both a web server and application in one image is kind of a Docker anti-pattern IMO.
@h1nk Thanks for chiming in, and in that case I believe you're right, the web server just shouldn't be part of the image. I don't know what changes would be required to create a good container for self-hosting, so I'm kinda leaning on the community here 😅
@h1nk your anti-pattern point is valid, yet the php-apache docker image is a fairly popular base image in the docker ecosystem, and nothing actually stops you from reverse-proxying from the current image (to use something like traefik in order to use you own https domain).
My first goal was to have something simple to configure and more accessible for users (get traefik+mysql+astral in a docker-composer, and off you go). If the prefered approach is to be more "atomical" in the docker-compose, then indeed we can provide a Dockerfile with only php-fpm, no problem :) The first downside i see, is that if you separate php you then have to share a volume b/w php and your webserver, opposed to the single php-apache config that saves you the trouble of having to configure a volume, etc
Hey, are people still interested in this? I personally would be, and I'd like to help
I believe @h1nk is right about it being a Docker anti-pattern but it is definitely very helpful for people who run something as https://github.com/linuxserver/docker-swag and use it as their main entry point for all other containers. I think if it would be able to run Astral with just Node, it would make the Docker image less bloated and we would not be running a typical web server such as Nginx or Apache behind another web server for those that use the SWAG image referenced above.
An example of this is the following Docker image https://github.com/itzg/docker-rcon-web-admin/blob/master/Dockerfile which you are then able to reverse proxy from SWAG or your web server container
@obvionaoe Yes, I'd definitely still like to see an official Docker image for this project. Something that just runs php-fpm, exposes a TCP port and leaves it up to the user to setup fastcgi_pass
on their own would be nice.
if someone could help me understand how to run php-fpm in Docker I can do the rest of the work! I've tried running a lot of the php images and they always have some issues
Agreed, I would love to see a php-fpm container but I think for new users a standalone container in the style of linuxservers.io or similar would be better, I'm using the cloud service atm but I'm anxious about affecting other users perf with my over 10k+ stars :P
I didn't know that there are other people with more than 10k+ stars. (ref. https://github.com/maguowei/starred/issues/116)
Does Astral handle this amount well, also in the proposed container? The app.astralapp.com always loggs me out when fetching the initial list.
It shouldn't be too hard to get a Compose going for a decoupled Nginx + PHP-FPM setup, very much like the one from Nextcloud. We only need to find a good Nginx template, that works well in accordance with the to be proposed Compose environment.
I didn't know that there are other people with more than 10k+ stars. (ref. maguowei/starred#116)
Does Astral handle this amount well, also in the proposed container? The app.astralapp.com always loggs me out when fetching the initial list.
It shouldn't be too hard to get a Compose going for a decoupled Nginx + PHP-FPM setup, very much like the one from Nextcloud. We only need to find a good Nginx template, that works well in accordance with the to be proposed Compose environment.
Unfortunately in my testing it doesn't, it doesn't log me out but it just keeps increasing the amount of stars, way over the amount I had, it got to like 100k at one point and when I refreshed it reset
Dear Astral's users,
Although this post is old, I would like to know if the community has progressed with installing Astral through Docker. So far, I have not seen clear installation instructions for a non-skilled user like me. Nevertheless, there are four good attempts to install Astral with Docker:
I would appreciate knowing if somebody could test Astral with Docker in 2024.