File: docker-compose.yml

Recommend this page to a friend!
  Classes of Paulo Henrique  >  Laravel Docker Starter  >  docker-compose.yml  >  Download  
File: docker-compose.yml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Laravel Docker Starter
Start a Laravel project using a Docker container
Author: By
Last change:
Date: 2 months ago
Size: 807 bytes
 

Contents

Class file image Download
version: '2'
services:

  # The Application
  app:
    build:
      context: ./
      dockerfile: app.dockerfile
    working_dir: /var/www
    container_name: laravel-php
    volumes:
      - ./:/var/www
    environment:
      - "DB_PORT=3306"
      - "DB_HOST=database"
    
  # The Web Server
  web:
    build:
      context: ./
      dockerfile: web.dockerfile
    working_dir: /var/www
    container_name: laravel-web
    volumes_from:
      - app
    ports:
      - 80:80

  # The Database
  database:
    image: mariadb:10.3
    container_name: laravel-database
    volumes:
      - dbdata:/var/lib/mysql
    environment:
      - "MYSQL_DATABASE=larastarter"
      - "MYSQL_USER=admin"
      - "MYSQL_PASSWORD=123"
      - "MYSQL_ROOT_PASSWORD=123"
    ports:
        - "3306:3306"

volumes:
  dbdata:

For more information send a message to info at phpclasses dot org.