version: '3'

services:
  db:
    image: mariadb
    container_name: mariadb
    volumes:
      - ./db:/var/lib/mysql
      - /etc/localtime:/etc/localtime:ro
    environment:
      - MARIADB_AUTO_UPGRADE=true
      - MARIADB_USER=gancio
      - MARIADB_DATABASE=gancio
      - MARIADB_PASSWORD=gancio
      - MARIADB_RANDOM_ROOT_PASSWORD=yes
    restart: always
  gancio:
    restart: always
    image: cisti/gancio
    container_name: gancio
    environment:
      - PATH=$PATH:/home/node/.yarn/bin
      - GANCIO_DATA=/home/node/data
      - NODE_ENV=production
      - GANCIO_DB_DIALECT=mariadb
      - GANCIO_DB_HOST=db
      - GANCIO_DB_PORT=3306
      - GANCIO_DB_DATABASE=gancio
      - GANCIO_DB_USERNAME=gancio
      - GANCIO_DB_PASSWORD=gancio
    volumes:
      - ./data:/home/node/data
    ports:
      - "127.0.0.1:13120:13120"
    depends_on:
        - db
