version: "3.1"

networks:
  loan-system:

services:
  loan-system: 
    build:
      context: .
      dockerfile: Dockerfile
    container_name: "loan-system"
    volumes:
      - .:/var/www/html/app
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - /var/www/html/app/vendor
      - ./nginx/default.conf:/etc/nginx/sites-available/default
    command: >
      bash -c "nginx
      && php-fpm
      && php artisan key:generate;"
    ports:
      - "${APP_PORT}:80"
    networks:
      - loan-system
