version: "2"
services:
  mariadb:
    image: docker.io/bitnami/mariadb:10.4
    environment:
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - MARIADB_USER=bn_prestashop
      - MARIADB_DATABASE=bitnami_prestashop
    volumes:
      - "mariadb_data:/bitnami/mariadb"
  prestashop:
    build: .
    ports:
      - "80:8080"
      - "443:8443"
    environment:
      - PRESTASHOP_HOST=${EXTERNAL_IP}
      - PRESTASHOP_DATABASE_HOST=mariadb
      - PRESTASHOP_DATABASE_PORT_NUMBER=3306
      - PRESTASHOP_DATABASE_USER=bn_prestashop
      - PRESTASHOP_DATABASE_NAME=bitnami_prestashop
      # ALLOW_EMPTY_PASSWORD is recommended only for development.
      - ALLOW_EMPTY_PASSWORD=yes
      - PRESTASHOP_EMAIL=dev@gratifypay.com
      - PRESTASHOP_PASSWORD=gratify
    volumes:
      - "prestashop_data:/bitnami/prestashop"
      - "../:/tmp/gratify"
      # - "./libprestashop.sh:/opt/bitnami/scripts/libprestashop.sh"
    depends_on:
      - mariadb
volumes:
  mariadb_data:
    driver: local
  prestashop_data:
    driver: local
