This project is a containerised Laravel application ready to use with Docker.
laravel-app-dockerized/
├── docker/
│ ├── dockerfiles/
│ │ ├── composer.Dockerfile
│ │ └── php.Dockerfile
│ └── php/
│ └── conf.d/
│ ├── error_reporting.ini
│ └── xdebug.ini
├── env/
│ └── postgres.env
├── nginx/
│ └── nginx.conf
└── docker-compose.yaml
- dockerfiles/: The directory containing the Docker files for the Composer component and PHP.
- env/: The directory where the file with environment variables for PostgreSQL is located.
- nginx/: The directory with the Nginx configuration file.
- docker-compose.yaml: A file that defines the structure and settings of Docker containers.
-
Make sure you have Docker and Docker Compose installed.
-
Clone the repository to your local machine:
git clone git@github.com:jibunnoeiko/Laravel-app-in-docker.git
-
Navigate to the project directory:
cd laravel-app-dockerized
-
Build the application using Docker Compose:
docker-compose up nginx -d --build
-
After successful launch, the application will be available at http://localhost/8000
- Database Settings: If you want to change the PostgreSQL database settings, edit the
postgres.env
file in theenv/
directory. - Nginx Configuration: If necessary, change the configuration in the
nginx.conf
file in thenginx/
directory. - Other Settings: Additional Docker and Laravel customisations can be made in the respective Docker composition files and Laravel configuration files.
To stop the application, run the following command:
docker-compose down
This will stop and delete the containers created for the application.
- Before launching, make sure that the ports used by the application are not occupied by other processes.
- Don't forget to perform Laravel migrations and configuration after running the containers, if necessary.
- Don't forget to install dependencies