version: '3'

services:
  load-balancer:
    hostname: load-balancer
    container_name: load-balancer
    build: ./builds/load-balancer
  webserver1:
    hostname: web1
    container_name: web1
    image: richarvey/nginx-php-fpm
    depends_on:
      - db
    volumes:
      - ./builds/php/:/var/www/html/
    stdin_open: true
    tty: true
    links:
      - db
    ports: 
      - '80:80'
  webserver2:
    hostname: web2
    container_name: web2
    build:
      context: ./builds/webserver/
      dockerfile: Dockerfile-web2
  webserver3:
    hostname: web3
    container_name: web3
    build:
      context: ./builds/webserver/
      dockerfile: Dockerfile-web3
  db:
    image: mysql
    container_name: mysql
    ports:
        - "9906:3306"
        - "33060:33060"
    volumes:
        - mysql-data
        - ./builds/mysql/skitter.sql:/docker-entrypoint-initdb.d/skitter.sql
    environment:
      MYSQL_ROOT_PASSWORD: super_secret
      MYSQL_USER: devuser
      MYSQL_PASSWORD: devpass
  nodejs:
    hostname: nodejs
    container_name: nodejs
    build: ./builds/nodejs
  ruby:
    hostname: ruby
    container_name: ruby
    build: ./builds/ruby
  flask:
    hostname: flask
    container_name: flask
    build: ./builds/flask
  php:
    hostname: php
    container_name: php
    build: ./builds/php

