version: "3.4"

services:
  webapp:
    image: ocelotsocialnetwork/develop-webapp:build-and-test
    build:
      context: webapp
      target: build-and-test
    environment:
      - NUXT_BUILD=/tmp/nuxt # avoid file permission issues when `rm -rf .nuxt/`
      - PUBLIC_REGISTRATION=true
    command: yarn run dev
    volumes:
      - ./webapp:/develop-webapp
      - webapp_node_modules:/develop-webapp/node_modules
  backend:
    image: ocelotsocialnetwork/develop-backend:build-and-test
    build:
      context: backend
      target: build-and-test
    command: yarn run dev
    environment:
      - SMTP_HOST=mailserver
      - SMTP_PORT=25
      - SMTP_IGNORE_TLS=true
      - "DEBUG=${DEBUG}"
      - PUBLIC_REGISTRATION=false
    volumes:
      - ./backend:/develop-backend
      - backend_node_modules:/develop-backend/node_modules
      - uploads:/develop-backend/public/uploads
  neo4j:
    volumes:
      - neo4j_data:/data
  maintenance:
    image: ocelotsocialnetwork/develop-maintenance:latest
    build:
      context: webapp
      dockerfile: Dockerfile.maintenance
    networks:
      - hc-network
    ports:
      - 3503:80
  mailserver:
    image: djfarrelly/maildev
    ports:
      - 1080:80
    networks:
      - hc-network

networks:
  hc-network:
volumes:
  webapp_node_modules:
  backend_node_modules:
  neo4j_data:
  uploads:
