version: '2.2'

services:
  peertube:
    image: chocobozzz/peertube:production-buster
    restart: always
    hostname: peertube
    container_name: peertube
    volumes:
      - ./peertube/config/default.yaml:/config/production.yaml:ro
      - ./peertube/storage:/app/storage
    expose:
      - 9000
    cpus: 1
#    cpu_shares: 512
    networks:
      mynet:
        ipv4_address: 172.115.0.101
      haraka:
        
  postgres:
    image: postgres:11
    hostname: postgres-peertube
    container_name: postgres-peertube
    restart: always
    environment:
      - POSTGRES_DB=peertube_dev
      - POSTGRES_USER=peertube
      - POSTGRES_PASSWORD=p33rtub3.
    volumes:
      - ./data:/var/lib/postgresql/data
    expose:
      - 5432
    networks:
      mynet:
        ipv4_address: 172.115.0.102

  redis:
    image: redis:alpine
    hostname: redis-peertube
    container_name: redis-peertube
    restart: always
    volumes:
      - ./redis:/data
    expose:
      - 6379
    networks:
      mynet:
        ipv4_address: 172.115.0.103

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

  haraka:
    external:
      name: harakawildduck_mynet

