Create a local Laravel dev environment with Docker

63 views Asked by At
version: '3'


networks:
 - laravel


services:
  nginx:
    image: nginx:stable-alpine
    container_name: nginx
    ports:
       - "8088:80"
    volumes:
       - ./src:/var/www/html
       - ./nginx/default.conf:/etc/nginx/conf.d/default.conf
    depends_on:
        - php
        - mysql
    networks:
        - laravel
  mysql:
        image: mysql:5.7.22
        container_name: mysql
        restart: unless-stopped
        tty: true
        ports:
          - "4306:3306"
        volumes:
          - ./mysql:/var/lib/mysql
        environment:
          MYSQL_DATABASE: homestead
          MYSQL_USER: root
          MYSQL_PASSWORD: 
          MYSQL_ROOT_PASSWORD: 
          SERVICE_TAGS: dev
          SERVICE_NAME: mysql
    networks:
       - laravel

  php:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: php
    volumes:
       - ./src:/var/www/html
    ports:
       - "9000:9000"
   networks:
      - laravel

this is my dock-compose.yml file but while running docker-compose build && docker-compose up -d

command yaml: line 37: did not find expected key error is coming

0

There are 0 answers