This repository demonstrates how to prepare a basic Laravel application for cloud deployment using Docker and FrankenPHP.
- Docker
- Docker Compose
git clone git@github.com:sevalla-templates/laravel-demo.git
cp .env.example .env
- Set
APP_KEY
variable from here composer install
npm i && npm run build
docker-compose up --build
- Access the application at http://localhost:8080
Dockerfile
: Production Docker image configurationcompose.yml
: Docker Compose configuration for local development.dockerignore
: Specifies files to be excluded from Docker builds
To build the production Docker image locally:
docker build -t laravel-demo .
To test the production image locally:
docker run -p 8080:8080 -e APP_KEY=base64:your-app-key-here laravel-demo
Replace your-app-key-here with your Laravel application key.
- Uses FrankenPHP runtime with Caddy web server
- Minimal configuration for a Laravel server
- Create a new app on Sevalla (deploy later)
- Change the app's build settings to be based on Dockerfile
- Set the required environment variable:
APP_KEY
- Deploy your application
This setup provides a basic Laravel server. To add more features or customize the application:
- Modify the Laravel application code in the app directory
- Update the
Dockerfile
if you need to install additional dependencies - Adjust the
compose.yml
file for any changes in local development setup
Contributions are welcome! Please feel free to submit a Pull Request.