You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/guides/frameworks/laravel/development-setup.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ description: Set up a Laravel development environment using Docker Compose.
4
4
weight: 20
5
5
---
6
6
7
-
## Development Environment Setup
7
+
## Development environment setup
8
8
9
9
This guide demonstrates how to set up a development environment for a Laravel application using Docker and Docker Compose. This setup includes essential services like PHP-FPM, Nginx, and a database (using Postgres, with MySQL/MariaDB as alternatives), which enable you to develop in an isolated and consistent environment.
10
10
11
11
> [!NOTE]
12
12
> If you want to quickly test this setup without configuring everything manually, you can download the [Laravel Docker Examples](https://github.com/rw4lll/laravel-docker-examples) repository. It includes pre-configured examples for both development and production environments.
13
13
14
-
### Project Structure
14
+
### Project structure
15
15
16
16
Start by creating a project structure that includes both the Laravel application and Docker-related files:
17
17
@@ -338,5 +338,3 @@ This command will build and start all the required services, including PHP, Ngin
338
338
### Summary
339
339
340
340
By setting up a Docker Compose environment for Laravel development, you ensure that your development setup is consistent and easily reproducible. This makes it easier for you and your team to collaborate on the same project, without worrying about differences in local environments.
Copy file name to clipboardExpand all lines: content/guides/frameworks/laravel/prerequisites.md
+1-3Lines changed: 1 addition & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -28,6 +28,4 @@ A fundamental understanding of Docker and how containers work will be helpful. I
28
28
This guide assumes you have a basic understanding of Laravel and PHP. Familiarity with Laravel’s command-line tools, such as [Artisan](https://laravel.com/docs/11.x/artisan), and its project structure is important for following the instructions.
29
29
30
30
- Laravel CLI: You should be comfortable using Laravel’s command-line tool (`artisan`).
Copy file name to clipboardExpand all lines: content/guides/frameworks/laravel/production-setup.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,14 +4,14 @@ description: Set up a production-ready environment for Laravel using Docker Comp
4
4
weight: 30
5
5
---
6
6
7
-
## Production Environment Setup
7
+
## Production environment setup
8
8
9
9
This guide demonstrates how to set up a production-ready Laravel environment using Docker and Docker Compose. This configuration is designed for streamlined, scalable, and secure Laravel application deployments.
10
10
11
11
> [!NOTE]
12
12
> If you want to quickly test this setup without configuring everything manually, you can download the [Laravel Docker Examples](https://github.com/rw4lll/laravel-docker-examples) repository. It includes pre-configured examples for both development and production environments.
13
13
14
-
### Project Structure
14
+
### Project structure
15
15
16
16
The project structure for production closely follows the development setup, with Dockerfiles and configurations tailored specifically for production.
17
17
@@ -40,7 +40,7 @@ my-laravel-app/
40
40
41
41
This structure includes a typical Laravel app, with a `docker` directory for Docker-related files like `php-fpm`, `php-cli` and `nginx` Dockerfiles, as well as `nginx.conf` config file, and the `compose.yaml` file to define the services.
42
42
43
-
### Create a Dockerfile for PHP-FPM (Production)
43
+
### Create a Dockerfile for PHP-FPM (production)
44
44
45
45
For production, the `php-fpm` Dockerfile creates an optimized image containing only necessary extensions and dependencies.
46
46
@@ -164,7 +164,7 @@ CMD ["php-fpm"]
164
164
165
165
This Dockerfile uses a multi-stage build to separate the build environment from the production environment. The first stage installs the necessary PHP extensions and Composer dependencies, while the second stage sets up the production environment with only the runtime libraries required.
166
166
167
-
### Create a Dockerfile for PHP-CLI (Production)
167
+
### Create a Dockerfile for PHP-CLI (production)
168
168
169
169
For production we often need a separate container to run Artisan commands, migrations, and other CLI tasks. This container will be very similar to the PHP-FPM container, and can look like this:
170
170
@@ -244,7 +244,7 @@ CMD ["bash"]
244
244
This Dockerfile is similar to the PHP-FPM Dockerfile, but it uses the `php:8.3-cli` image as the base image and sets up the container for running CLI commands.
245
245
246
246
247
-
### Create a Dockerfile for Nginx (Production)
247
+
### Create a Dockerfile for Nginx (production)
248
248
249
249
Nginx serves as the web server for the Laravel application. We can include static assets directly to the container. Here's an example of possible Dockerfile for Nginx:
0 commit comments