Last active
April 29, 2021 10:38
-
-
Save ohmydevops/8599e0a92996aa28b19fd96b22a58d10 to your computer and use it in GitHub Desktop.
Laravel 8 sail configurations for my projects (PHP7.4 + MySQL8.0 + Redis5.0 + PHPMyAdmin5)
This file contains 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
# For more information: https://laravel.com/docs/sail | |
version: '3' | |
services: | |
laravel.test: | |
container_name: sail-laravel | |
build: | |
context: ./vendor/laravel/sail/runtimes/7.4 | |
dockerfile: Dockerfile | |
args: | |
WWWGROUP: '${WWWGROUP}' | |
image: sail-7.4/app | |
ports: | |
- '${APP_PORT:-80}:80' | |
environment: | |
WWWUSER: '${WWWUSER}' | |
LARAVEL_SAIL: 1 | |
volumes: | |
- '.:/var/www/html' | |
networks: | |
- sail | |
depends_on: | |
- mysql | |
- redis | |
redis: | |
image: 'redis:5' | |
container_name: sail-redis | |
command: redis-server --requirepass ${REDIS_PASSWORD:-123456789} | |
ports: | |
- '${FORWARD_REDIS_PORT:-6379}:6379' | |
volumes: | |
- 'sailredis:/data' | |
networks: | |
- sail | |
healthcheck: | |
test: ["CMD", "redis-cli", "ping"] | |
mysql: | |
image: 'mysql:8.0' | |
container_name: sail-mysql | |
ports: | |
- '${FORWARD_DB_PORT:-3306}:3306' | |
environment: | |
MYSQL_ROOT_PASSWORD: '${DB_PASSWORD}' | |
MYSQL_DATABASE: '${DB_DATABASE}' | |
MYSQL_USER: '${DB_USERNAME}' | |
MYSQL_PASSWORD: '${DB_PASSWORD}' | |
volumes: | |
- 'sailmysql:/var/lib/mysql' | |
networks: | |
- sail | |
healthcheck: | |
test: ["CMD", "mysqladmin", "ping"] | |
restart: always | |
phpmyadmin: | |
image: phpmyadmin:5.0.4 | |
container_name: sail-phpmyadmin | |
networks: | |
- sail | |
environment: | |
PMA_HOST: mysql | |
PMA_PORT: 3306 | |
UPLOAD_LIMIT: 1G | |
depends_on: | |
- mysql | |
restart: always | |
ports: | |
- '${PHPMYADMIN_PORT:-9090}:80' | |
networks: | |
sail: | |
driver: bridge | |
volumes: | |
sailmysql: | |
driver: local | |
sailredis: | |
driver: local |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Installation / Running: