Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

the_lar's avatar

Deployment considerations using dockerized laravel app to AWS

Hi all,

I've been following along with this series https://laracasts.com/series/the-docker-tutorial about Docker with a view to using this approach with a new project - no issues locally, all works fine and it seems great. I've got a Laravel App and can run migrations, tinker and so on.

I now want to deploy this onto AWS EC2 for a staging site but I'm not sure of the best approach? Obviously I want to use GIT, so should I initialise my GIT repository in the project root, above the src folder, or should it be inside the src folder? If I initialise it in the project root, I'd have the docker files and could just run the docker commands on the EC2 server (once I've installed Docker there) I guess? But how would migrations and keeping the data synced between my local environment and my staging server work? If my mysql folder is under version control and I pull that down onto EC2 would that mean that all my data is synced? Would that work?

Any suggestions, gottchas to consider or general advice here would be very gratefully received!

Kevin

0 likes
0 replies

Please or to participate in this conversation.