Skip to content

Latest commit

 

History

History
99 lines (73 loc) · 2.44 KB

File metadata and controls

99 lines (73 loc) · 2.44 KB

Laravel Docker Stack

Dockerize any Laravel application with support for HTTPS and local tooling.

Prerequisites

  • Docker Engine & Docker Compose
  • Git
  • nginx-proxy – local HTTPS and vhost routing
  • Optional: minio – local S3-compatible storage
  • Optional: mailpit – local email server

Installation

  1. Copy or clone this repository into the scripts folder of your Laravel project.

  2. Run initial setup

    sh scripts/local/initial-setup.sh

    This script will create the .env file and guide you through configuration.

  3. Access the application

Project Management Scripts

  • Initial setup

    sh scripts/local/initial-setup.sh

    This can be run multiple times if you need to reset the project.

  • Start containers

    sh scripts/local/start.sh
  • Stop containers

    sh scripts/local/down.sh
  • Build or rebuild the project

    sh scripts/local/build.sh
  • Restart containers

    sh scripts/local/restart.sh
  • Deploy (start + application scripts, in here you can add additional scripts)

    sh scripts/local/deploy.sh
  • Execute PHP container

    sh scripts/local/console.sh

Deploy on Server

  1. Copy the setup to the server-specific folder:
    cp -r scripts/local scripts/<server>
    rm scripts/<server>/initial-setup.sh
  2. Create a new .env for the server:
    cp scripts/<server>/.env.example scripts/<server>/.env
    # Edit the values to match server configuration
  3. Edit other files as needed:
  4. Deploy:
    sh scripts/<server>/deploy.sh

Tip

  • Consider moving some ignored files to the common directory if they should be shared across all environments.

Troubleshooting

  • Docker Issues: For older versions you might want to remove COMPOSE_BAKE from .env.
  • Docker Compose Issues: Please update and ensure you can use docker compose, not old version docker-compose

License

This project is licensed under the MIT License. See LICENSE for details.

Contributing

Contributions are welcome! Please open issues or submit pull requests following the repository guidelines.

Happy Coding