version: '3.8'

services:
  web:
    build: .
    command: /app/entrypoint.sh
    volumes:
      - .:/app
    ports:
      - "8000:8000"
    env_file:
      - .env
    depends_on:
      - db

  db:
    image: mariadb:10.6
    restart: always
    environment:
      MYSQL_DATABASE: ${DB_NAME:-mydatabase}
      MYSQL_USER: ${DB_USER:-myuser}
      MYSQL_PASSWORD: ${DB_PASS:-mypassword}
      MYSQL_ROOT_PASSWORD: ${DB_PASS:-mypassword}
    volumes:
      - db_data:/var/lib/mysql

volumes:
  db_data:
