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 files #323

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

unsync
Copy link

@unsync unsync commented Oct 5, 2020

In response to #212

@unsync unsync mentioned this pull request Oct 5, 2020
@syropian
Copy link
Member

syropian commented Oct 5, 2020

Thanks for doing this! Now that I can take a closer look, I have a few questions:

  1. 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.
  2. Is it difficult to set the timezones to just use UTC? I think thats the most generic option for everyone.
  3. Does the .env.template file need to exist, since we already have a .env.example file in the root?

@unsync
Copy link
Author

unsync commented Oct 5, 2020

  1. 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
  2. I see you point about timezones, that is my bad, used my personnal templates to do this ^^
  3. 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

@syropian
Copy link
Member

syropian commented Oct 5, 2020

@unsync

  1. Gotcha, if it's too much hassle to switch it to Nginx, don't worry about it.
  2. All good! I figured as much 😄
  3. 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.

@unsync
Copy link
Author

unsync commented Oct 5, 2020

  1. 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 ?

@syropian
Copy link
Member

@unsync I could be totally off the mark but I assumed people who wanted Docker support mostly wanted it as a local dev tool.

@unsync
Copy link
Author

unsync commented Oct 15, 2020

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 !

@h1nk
Copy link

h1nk commented Nov 8, 2020

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.

@syropian
Copy link
Member

syropian commented Nov 8, 2020

@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 😅

@unsync
Copy link
Author

unsync commented Nov 21, 2020

@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

@obvionaoe
Copy link

obvionaoe commented Aug 26, 2021

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

@h1nk
Copy link

h1nk commented Sep 4, 2021

@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.

@obvionaoe
Copy link

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

@agnosticlines
Copy link

agnosticlines commented Jan 17, 2022

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

@almereyda
Copy link

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.

@agnosticlines
Copy link

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

@fdbesanto2
Copy link

fdbesanto2 commented Mar 30, 2024

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.

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

Successfully merging this pull request may close these issues.

None yet

7 participants