Skip to content

Instantly share code, notes, and snippets.

@Aabill
Last active February 13, 2024 14:45
Show Gist options
  • Save Aabill/fdba9c87a2815c25cc7ffa99c140fc28 to your computer and use it in GitHub Desktop.
Save Aabill/fdba9c87a2815c25cc7ffa99c140fc28 to your computer and use it in GitHub Desktop.
Laravel App Docker Compose Sample Dev Environment
version: '3'
services:
web:
build:
context: .
dockerfile: ./nginx/Dockerfile
ports:
- "9090:80"
networks:
- networkname
working_dir: /var/www/app
volumes:
- ./app:/var/www/app
depends_on:
- app
- db
app:
build:
context: .
dockerfile: ./php/Dockerfile
working_dir: /var/www/app
networks:
- networkname
volumes:
- ./app:/var/www/app
depends_on:
- db
node:
build:
context: .
dockerfile: ./node/Dockerfile
working_dir: /var/www/app
networks:
- networkname
volumes:
- ./app:/var/www/app
depends_on:
- app
command: sh -c "npm i && npm run watch"
db:
image: mysql:8.1
ports:
- 3307:3306
environment:
- MYSQL_ROOT_PASSWORD=rootpassword
- MYSQL_DATABASE=databasename
- MYSQL_USER=databaseuser
- MYSQL_PASSWORD=databasepassword
volumes:
- mysql8.1data:/var/lib/mysql
networks:
- networkname
networks:
networkname:
name: networkapp
driver: bridge
volumes:
mysql8.1data:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment