Skip to content

Instantly share code, notes, and snippets.

@einnar82
Last active June 24, 2020 07:16
Show Gist options
  • Save einnar82/df281f89ec80b37589d5582685425e46 to your computer and use it in GitHub Desktop.
Save einnar82/df281f89ec80b37589d5582685425e46 to your computer and use it in GitHub Desktop.
Sample docker-compose.yml
version: "3"
networks:
laravel:
services:
nginx:
image: nginx:stable-alpine
container_name: nginx
ports:
- "8080:80"
volumes:
- /d/src:/var/www/html
- /d/nginx/conf.d/default.conf:/etc/nginx/conf.d/default.conf
depends_on:
- php
- mysql
networks:
- laravel
mysql:
image: mysql:5.7.29
container_name: mysql
restart: unless-stopped
tty: true
ports:
- "3306:3306"
environment:
MYSQL_DATABASE: homestead
MYSQL_USER: homestead
MYSQL_PASSWORD: secret
MYSQL_ROOT_PASSWORD: secret
SERVICE_TAGS: dev
SERVICE_NAME: mysql
networks:
- laravel
php:
build:
context: ./php
dockerfile: Dockerfile
container_name: php
volumes:
- /d/src:/var/www/html
ports:
- "9000:9000"
networks:
- laravel
composer:
image: composer:latest
container_name: composer
volumes:
- /d/src:/var/www/html
working_dir: /var/www/html
depends_on:
- php
networks:
- laravel
# npm:
# image: node:13.7
# container_name: npm
# volumes:
# - ./src:/var/www/html
# working_dir: /var/www/html
# entrypoint: ["npm"]
artisan:
build:
context: ./php
dockerfile: Dockerfile
container_name: artisan
volumes:
- /d/src:/var/www/html
depends_on:
- mysql
working_dir: /var/www/html
entrypoint: ["php", "/var/www/html/artisan"]
networks:
- laravel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment