Skip to content

Instantly share code, notes, and snippets.

@theconsolelogger
Last active October 19, 2019 08:55
Show Gist options
  • Save theconsolelogger/e03cfd0a91566d382f300d3853b63ffb to your computer and use it in GitHub Desktop.
Save theconsolelogger/e03cfd0a91566d382f300d3853b63ffb to your computer and use it in GitHub Desktop.
A Docker Compose file for running a Laravel Docker image with a MySQL database.
version: "3.7"
services:
api:
image: docker.pkg.github.com/jonathanstaniforth/laravel-docker/laravel-mysql:v1.1
ports:
- 80:80
- 443:443
volumes:
- ./:/var/www/laravel
depends_on:
- database
networks:
- overlay
database:
image: mysql
command: --default-authentication-plugin=mysql_native_password
environment:
MYSQL_ROOT_PASSWORD: <root_password>
MYSQL_USER: <user_name>
MYSQL_PASSWORD: <user_password>
MYSQL_DATABASE: <database_name
volumes:
- type: bind
source: ./dbdata
target: /var/lib/mysql
ports:
- 3306:3306
networks:
- overlay
networks:
overlay:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment