DEV Community

Automata
Automata

Posted on • Edited on

3 1 1 1 1

Building Docker Container for a Laravel Project

In the first place, we need a web server that can support someone specific php version.

  • Web server: nginx
  • Php version: php-7.4

When we need two containers. We will create a docker-composer.yml usign this structure.

# Main Directory
└── docker-laravel
    └── docker-compose.yml
    └── README.md
    └── phpfpm
        └── Dockerfile
    └── nginx
        └── default.conf
        └── Dockerfile
    └── laravel-project          # Laravel Project
        └── app.php
        └── ...
        └── composer.json
Enter fullscreen mode Exit fullscreen mode

Or just we download it in a chosen location using following command:

git clone https://github.com/automatape/docker-laravel.git
Enter fullscreen mode Exit fullscreen mode
cd docker-laravel
Enter fullscreen mode Exit fullscreen mode

For create and start the container (in first plane)

docker-compose up
Enter fullscreen mode Exit fullscreen mode

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay