volumes:
  redis_data:
  postgresql_data:
  mysql_data:
  dia_data_tmp:
  dia_data_bundle:

services:
  diaspora:
    build:
      context: .
      dockerfile: Dockerfile
      args:
        DIA_UID: "${DIASPORA_ROOT_UID}"
        DIA_GID: "${DIASPORA_ROOT_GID}"
    image: diaspora:dev-latest
    volumes:
      - "${DIASPORA_ROOT}:/diaspora:rw"
      - dia_data_tmp:/diaspora/tmp
      - dia_data_bundle:/diaspora/vendor/bundle
    ports:
      - ${DIASPORA_DOCKER_PORT:-3000}:3000
    environment:
      ENVIRONMENT_REDIS: redis://redis
      SERVER_LISTEN: tcp://0.0.0.0:3000
    depends_on:
      - "${DIASPORA_DOCKER_DB}"
      - redis

  redis:
    image: redis:7
    command: redis-server --save 60 1 --loglevel warning
    volumes:
      - redis_data:/data

  postgresql:
    image: postgres:15
    ports:
      - 55432:5432
    volumes:
      - postgresql_data:/var/lib/postgresql
    environment:
      POSTGRES_PASSWORD: postgres

  mysql:
    image: mariadb:lts
    ports:
      - 53306:3306
    volumes:
      - mysql_data:/var/lib/mysql
    environment:
      MARIADB_ROOT_PASSWORD: mysql
      MARIADB_AUTO_UPGRADE: 1
