Skip to content

Conversation

@nazmulpcc
Copy link

πŸ“ Why is PR is required?

Answer:

βœ… Checklist

  • My code follows the project's contribution guidelines.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have added necessary documentation (if applicable).
  • I have tested this code locally.

πŸ› οΈ Changes

  • Bug fix (non-breaking change that fixes an issue)
  • Feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (code improvement without changing external behavior)
  • Other (please specify):

πŸ“Œ Related Issues (e.g., Fixes #123, Closes #456)

Ans: None

πŸ“Έ Screenshots (if applicable)

Ans: None

πŸ“£ Additional Comments

Ans: None

@nazmulpcc nazmulpcc changed the title [Draft] Docker environment [Draft] Production Docker environment Jun 19, 2025
@nazmulpcc
Copy link
Author

@theihasan Can you please check if all features of the app runs properly in docker?
If you have docker installed, updating the .env file and running docker compose up -d should be enough to run the application.

@theihasan
Copy link
Owner

@nazmulpcc I used orb stack. Can I test with this?

composer.json Outdated
"laravel/breeze": "^2.0",
"laravel/framework": "^11.0",
"laravel/horizon": "^5.32",
"laravel/octane": "^2.10",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need Octen. Octen has too many memory leak issue and this application is not needed octen at this moment. For asyn programming I am interested in ReactPHP over octen.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Octane is used here mainly as a replacement of FPM. Scaling a revere proxyable container is easier with much less configuration.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will see if I can achieve a reasonable production fpm setup without octane

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you bhai

@nazmulpcc
Copy link
Author

@nazmulpcc I used orb stack. Can I test with this?

Yes, orb stack supports docker compose command and it should work as expected.

@nazmulpcc
Copy link
Author

@theihasan It works with FPM now, and I have removed octane for now.
I also want to mention what this PR will change in regards to production deployment.
If this PR is merged, the way I designed it, to deploy this application you will basically need two files, the .env file and the docker-compose.yml file. You don't actually need to clone the whole repo.
To update the app, all you would do is do a docker compose pull and then docker compose up -d
This will result in a clean production environment.
Also, for that to work, we need to setup a build pipeline for the docker images, which I can do in a seperate PR. We will also need to setup a docker hub account.

@nazmulpcc
Copy link
Author

@theihasan I did not fully investigate the redis situation before.
I can see you have customized the .env.example to accomodate for different redis connections & using third party redis providers.
Is there any benefits to using third party providers, especially when using docker & thus it doesn't require any additional setup?

@theihasan
Copy link
Owner

If I have multiple server then how I can manage session without a external redis

@nazmulpcc
Copy link
Author

If I have multiple server then how I can manage session without a external redis

That's very easy.
Simplest thing you can do Is deploy the app container in another server and then update the env to point the db & redis to the "master" server.
But a better solution would be to make all the servers part of a docker swarm and then just instruct docker how many instances of each container we need. Docker will also load balance the app container.

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.

2 participants