-
Notifications
You must be signed in to change notification settings - Fork 9
Generate a Laravel project
In order to generate your docker-compose you need to open your favority internet browser, go to https://okty.io/ and press "Start" !
A laravel application is a typical php application and need 4 containers to work :
- Nginx : Handle HTTP requests
- PHP : Generate your website content and execute all the magic things
- MySQL : Store your data
- Adminer : Manage your database (Optional)
We'll start with Mysql and Adminer !
Select Mysql in the list
You may leave the first group with default values
In the second configuration group "Connection" you have to specify your authentication data
Once all the fields are filled, save your container
In the list, select adminer.
Adminer is simple and small container that doesn't require much configuration
That's why we'll leave all the configuration as is it and save the container
PHP is generally the most complicated container to configure because of all the extensions available and required depending of the project you're working on.
Don't worry ! Okty is here to help you
The first step is to go search on the laravel documentation and check what are the prerequisites
Luckily, most of the prerequisites are already satisfied by default !
The only php extension we have to add is PDO_Mysql.
You may find information about php extensions and which one is installed on a empty container on this wiki page
Knowing this, we'll select in the php extensions list "PDO Mysql" and add it.
The second step is to tell Okty where your code will be.
We recommend to add the docker-compose at the root of your project, default value is just right.
That's all for this container ! Let's save and go on with nginx.
Finally, the last container to configure before being able to run your project.
Select nginx in the list.
Local path should be the same as specified to php in the previous step.
We recommend to leave it by default at the root of the project
Regarding the web port used on the host machine, 8080 works perfectly but feel free to used whatever value you want that is not already in use by another application.
The max upload size depends of your needs, 2Mo is a default value, feel free to change it.
Nginx needs to know which container will handle PHP, select the id of the php container
(leave empty if you don't need php)
The last field allows us the use modern frameworks which has a dedicated public folder which contains the index.php
In the case of a Laravel application, this folder is named "public"