version: '2'

services:
  ms:
    image: metasploitframework/metasploit-framework:latest
    hostname: ms
    container_name: ms
#    entrypoint:
#      - /bin/sleep
#      - 1d
    environment:
      DATABASE_URL: postgres://msf:msf@db-ms:5432/msf
    stdin_open: true
    tty: true
    links:
      - db
    ports:
      - 4444:4444
    volumes:
      - ./msf4:/home/msf/.msf4
    networks:
      mynet:
        ipv4_address: 172.222.0.101
        
  db:
    image: postgres:10-alpine
    hostname: db-ms
    container_name: db-ms
    expose:
     - 5432
    volumes:
      - ./pg_data:/var/lib/postgresql/data
    networks:
      mynet:
        ipv4_address: 172.222.0.102

networks:
  mynet:
    driver: bridge
    ipam:
      config:
      - subnet: 172.222.0.0/24

