tnort's avatar
Level 4

Laravel deployment setup

Hi all,

Anyone would help me understand how a proper deployment setup should look?

Do you have to integrate tests or schedule deployments or use something like git action for tests?

What part does Docker play in this stack including Sail?

Thank you, Mihail

0 likes
6 replies
Sinnbeck's avatar

Personally I work alone. My work flow is this

  1. Push code to git
  2. Ensure all tests are successful in either github action or jenkins
  3. Deploy

I use ploi to set up my servers and deployment. I don't use docker in production, only in dev.

Sail should never be used in production

1 like
tnort's avatar
Level 4

@Sinnbeck, do you also have a testing server setup or just the main server? Also, do you use Docker with Sail or mainly without and what role does it play in your flow?

As far as I could figure out, Docker is mainly used on the development side and especially to get you started or basically to remove all that pain of setting up the dev env. But for some ppl who use Laravel and PHP stack on daily basis it doesn't add much value, does it?

Sinnbeck's avatar

@tudosm I use github actions or a self hosted jenkins server.

I use Lando instead of sail locally. On production I just use a regular nginx + php installation. No docker

1 like
martinbean's avatar

@tudosm Deployment processes look different from project to project; there’s no one size fits all. But there is some commonality between them.

What you’re describing is commonly referred to as CI (continuous integration) and CD (continuous deployment). So yes, in a lot of projects I’ll use GitHub Actions to run tests when I commit. You can then also set up restrictions so that only commits with passing tests are merged to your main branch. If you then automatically deploy code when merged into your main branch (and you’ve ensured only code with passing tests is merged to your main branch), then you’re also ensuring that only code where tests have passed ends up getting deploying into production.

Docker is a way of containerising apps. You can use them in development, you can use them in production, but you don’t have to. Deploying could be FTP-ing or SSH-ing files to a server, or triggering a deploying using a service like Forge, or deploying to an cloud provider like AWS or an IaaS like Heroku. It completely depends where and how you host your website, as to how you’d do around deploying it.

1 like
tnort's avatar
Level 4

@martinbean, how would I use docker in production? Would I have to install docker on the server as well?

Please or to participate in this conversation.