version: '3.3'
services:
  web:
    image: nginx:latest
    container_name: parser-web
    ports:
       - 83:80
       - 93:93
    volumes:
      - ./:/app
      - ./docker/web/conf:/etc/nginx/conf.d
      - ./docker/web/logs:/var/log/nginx/
    links:
      - app
    networks:
      - internal

  app:
    build:
      context: ./
      dockerfile: ./docker/app/Dockerfile
    container_name: parser-app
    volumes:
      # Re-use local composer cache via host-volume
      - ~/.composer-docker/cache:/root/.composer/cache:delegated
      # Mount source-code for development
      - ./:/app
    expose:
      - 9000
    networks:
      - internal

  pgsql:
    image: postgres:11
    ports:
      - "15433:5432"
    volumes:
      - pgdb:/var/lib/postgresql/data
    environment:
      - POSTGRES_DB=parser
      - POSTGRES_USER=parser
      - POSTGRES_PASSWORD=secret
    networks:
      - internal

volumes:
  pgdb:

networks:
  internal:
    driver: bridge
    ipam:
      driver: default
        #config:
      #- subnet: 192.168.92.0/28