version: '2'

services:
  db:
    image: 'mariadb:10.4.14'
    environment:
    - MYSQL_ALLOW_EMPTY_PASSWORD=yes
    volumes:
    - "nitrate_db_data:/var/lib/mysql"
    restart: always
    command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci

  web:
    depends_on:
    - db
    restart: always
    build:
      context: .
      dockerfile: docker/dev/Dockerfile
    image: quay.io/nitrate/nitrate:develop
    ports:
    - '8000:8000'
    volumes:
    - "nitrate_uploads:/var/nitrate/uploads"
    environment:
      NITRATE_DB_ENGINE: mysql
      NITRATE_DB_HOST: db
      NITRATE_DB_PORT: 3306
      NITRATE_DB_NAME: nitrate
      NITRATE_DB_USER: root
      NITRATE_DB_PASSWORD:

volumes:
  nitrate_db_data:
  nitrate_uploads:
