Created
December 31, 2024 14:33
-
-
Save asterion/5a40d5c4b9ebb68f39cf32d6c1ad4212 to your computer and use it in GitHub Desktop.
Docker Compose For Laravel PHP 8.1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
services: | |
php-fpm: | |
container_name: php-fpm | |
ports: | |
- "9000:9000" | |
volumes: | |
- ./:/var/www/html | |
- ./logs/php:/var/log/php | |
environment: | |
- APP_ENV=local | |
- APP_DEBUG=true | |
depends_on: | |
- mariadb | |
- redis | |
build: | |
context: . | |
dockerfile: ./php/Dockerfile | |
nginx: | |
image: nginx:latest | |
container_name: nginx | |
ports: | |
- "8080:80" | |
volumes: | |
- ./:/var/www/html | |
- ./nginx/nginx.conf:/etc/nginx/nginx.conf | |
depends_on: | |
- php-fpm | |
mariadb: | |
image: mariadb:latest | |
container_name: mariadb | |
environment: | |
MYSQL_ROOT_PASSWORD: root | |
MYSQL_DATABASE: laravel | |
MYSQL_USER: laravel | |
MYSQL_PASSWORD: secret | |
ports: | |
- "3306:3306" | |
volumes: | |
- mariadb_data:/var/lib/mysql | |
redis: | |
image: redis:alpine | |
container_name: redis | |
ports: | |
- "6379:6379" | |
volumes: | |
- redis_data:/data | |
mailhog: | |
image: mailhog/mailhog | |
container_name: mailhog | |
ports: | |
- "8025:8025" | |
environment: | |
- MH_STORAGE=maildir | |
queue-worker: | |
image: php:8.1-cli | |
container_name: queue-worker | |
working_dir: /var/www/html | |
volumes: | |
- ./:/var/www/html | |
- ./logs/queue:/var/log/queue | |
command: php artisan queue:work --sleep=3 --tries=3 | |
depends_on: | |
- redis | |
horizon: | |
container_name: horizon | |
working_dir: /var/www/html | |
volumes: | |
- ./:/var/www/html | |
- ./logs/horizon:/var/log/horizon | |
command: php artisan horizon | |
build: | |
context: . | |
dockerfile: ./php/horizon/Dockerfile | |
depends_on: | |
- redis | |
volumes: | |
mariadb_data: | |
redis_data: |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment