version: '2'

services:
  gnusocial:
    build: ./gnusocial
    restart: always
    container_name: gnusocial
    hostname: gnusocial
    entrypoint:
      - /bin/bash
      - /entrypoint.sh
    volumes:
      - ./gnusocial/entrypoint.sh:/entrypoint.sh:ro
      - ./gnusocial/httpd.conf:/usr/local/apache2/conf/httpd.conf:ro
      - ./gnusocial/htaccess:/usr/local/apache2/htdocs/public/.htaccess:ro
      - ./gnusocial/php.ini:/etc/php/7.3/fpm/php.ini:ro
      - ./gnusocial/config.php:/gnusocial/config.php
      - ./gnusocial/file:/gnusocial/file
      - ./gnusocial/avatar:/gnusocial/public/avatar
#      - ./gnusocial/ActivityPub:/gnusocial/plugins/ActivityPub
    expose:
      - 80
    depends_on:
      - mariadb-gnusocial
    networks:
      mynet:
        ipv4_address: 172.132.0.101
        
  mariadb-gnusocial:
    image: mariadb:10
    container_name: mariadb-gnusocial
    hostname: mariadb-gnusocial
    restart: always
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
    environment:
      - MYSQL_ROOT_PASSWORD=gnus0c14l
      - MYSQL_DATABASE=gnusocial
      - MYSQL_USER=gnusocial
      - MYSQL_PASSWORD=gnus0c14l
    volumes:
      - ./mariadb:/var/lib/mysql
    expose:
      - 3306
    networks:
      mynet:
        ipv4_address: 172.132.0.102

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

