Skip to content

Instantly share code, notes, and snippets.

@b4oshany
Created June 15, 2021 13:40
Show Gist options
  • Save b4oshany/123f7515de370425ef942140a896ebed to your computer and use it in GitHub Desktop.
Save b4oshany/123f7515de370425ef942140a896ebed to your computer and use it in GitHub Desktop.
Laravel Docker Compose
version: '3.3'
services:
web:
image: jamaicandevelopers/laravel-nginx-apline:php7.2
ports:
- '18481:80'
- '18482:81'
restart: unless-stopped
volumes:
- './:/var/www'
environment:
- APP_DEBUG=true
- APP_DB_PORT=3306
- APP_DB_HOST=db
- APP_DB_NAME=laravel
- APP_DB_USERNAME=root
- APP_DB_PASSWORD=laravel
depends_on:
- db
#MySQL Service
db:
image: mysql:5.7.22
container_name: db
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: laravel
MYSQL_ROOT_PASSWORD: laravel
SERVICE_TAGS: dev
SERVICE_NAME: mysql
volumes:
- dbdata:/var/lib/mysql/
- ./mysql/my.cnf:/etc/mysql/my.cnf
networks:
- dbnet
networks:
dbnet:
external:
name: dbnet
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment