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