version: '3.7'

services:

  wekandb-dev:
    image: mongo:4.0.12
    container_name: wekan-dev-db
    restart: unless-stopped
    command: mongod --smallfiles --oplogSize 128
    networks:
      - wekan-dev-tier
    expose:
      - 27017
    volumes:
      - wekan-dev-db:/data/db
      - wekan-dev-db-dump:/dump

  wekan-dev:
    container_name: wekan-dev-app
    restart: always
    networks:
      - wekan-dev-tier
    build:
      context: ..
      dockerfile: .devcontainer/Dockerfile
    ports:
      - 3000:3000
      - 9229:9229
    environment:
      - MONGO_URL=mongodb://wekandb-dev:27017/wekan
      - ROOT_URL=http://localhost:3000
      - WITH_API=true
      - RICHER_CARD_COMMENT_EDITOR=true
      - BROWSER_POLICY_ENABLED=true
    depends_on:
      - wekandb-dev
    volumes:
      - ..:/app:delegated
    command:
      sleep infinity

volumes:
  wekan-dev-db:
    driver: local
  wekan-dev-db-dump:
    driver: local

networks:
  wekan-dev-tier:
    driver: bridge
