Created
February 16, 2021 13:09
-
-
Save christopherarter/588ae9a98b0c7fa736488178cb6ce7f2 to your computer and use it in GitHub Desktop.
Laravel Easy Database Docker Compose
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
version: '3' | |
services: | |
laravel_db: | |
image: mariadb | |
ports: | |
- 3306:3306 | |
volumes: | |
- ./db_data:/var/lib/mysql | |
environment: | |
- MYSQL_DATABASE=laravel_db | |
- MYSQL_ROOT_PASSWORD=root | |
container_name: laravel_db | |
#unit testing datbase | |
laravel_db_test: | |
image: mariadb | |
ports: | |
- 3305:3306 | |
volumes: | |
- ./db_data_test:/var/lib/mysql | |
environment: | |
- MYSQL_DATABASE=laravel_db_test | |
- MYSQL_ROOT_PASSWORD=root | |
container_name: laravel_db_test | |
#caching | |
cache: | |
container_name: laravel_cache | |
image: redis:4.0.11 | |
ports: | |
- 6379:6379 | |
volumes: | |
db_data: {} | |
db_data_test: {} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use
docker-compose.yml
and paste the content of this gist into that file (and save).docker-compose up
.env
file, make sure your credentials match the username (root) and password (root) like this 👇