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

Dockerfile Generator #54

Open
fideloper opened this issue Sep 25, 2023 · 1 comment
Open

Dockerfile Generator #54

fideloper opened this issue Sep 25, 2023 · 1 comment

Comments

@fideloper
Copy link

fideloper commented Sep 25, 2023

Similar to what Sam did for Ruby, I think creating a Dockerfile generator would be interesting.

  1. It's useful for anyone who wants to Dockerize Laravel
  2. There are "flavors" of Docker container that we can allow people to choose from:
    • Nginx + PHP-FPM vs Nginx Unit vs Nginx + Laravel Octane
    • Whether we should build static assets or not (NodeJS build step)
    • PHP Version
    • Node Version
  3. It de-couples flyctl from the Laravel stuff generated

My proposed command would be something like:

./fly dockerize --php 8.2 --node 16 --unit 

Potential flags:

--php=8.2   - (version) Set the PHP version
--node=16   - (version) Set the Node version
--no-static - (bool) Do not build static assets (--node is ignored)
--unit      - (bool) Install container with just Nginx Unit (no Nginx / PHP-FPM)
--fpm       - (bool) Install container with Nginx + PHP-FPM (default)
--octane    - (bool) Install container with Nginx + Octane support (swoole and roadrunner)

These settings could perhaps also be saved to a local .fly.yaml file or similar so when users run fly launch we could pre-populate PHP_VERSION / NODE_VERSION OR those numbers could be hard-coded in the resulting Dockerfile so we don't need to care about those Docker build arguments (currently we have to set Docker build args).

@KTanAug21
Copy link
Contributor

KTanAug21 commented Sep 25, 2023

This would be an awesome addition to the fly-laravel package!

I agree on the settings saved on a .fly.yaml config, it makes the flag config passed by the user visible and findable somewhere( answers the short-term mem-loss question of what did I pass as flag again? Without having to check cmd history ).

Also, we can possibly read from that file as well instead of relying on flags. If there are no flags, we can check that file. If there are flags, override the values in that file?

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

No branches or pull requests

2 participants