
services:
  web:
    build: .
    # ports:
    #   - "80:80"
    volumes:
      - ./php:/var/www/html
    environment:
      DB_HOST: db
      DB_NAME: pwd_mgr
      DB_USER: passman_app
      DB_PASS: passman_app_pw
    depends_on:
      - db

  proxy:
    image: caddy:2
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./Caddyfile:/etc/caddy/Caddyfile:ro
      - caddy_data:/data
      - caddy_config:/config
    depends_on:
      - web

  db:
    image: mariadb:11
    container_name: passman_db
    environment:
      MARIADB_ROOT_PASSWORD: rootpass
      MARIADB_DATABASE: pwd_mgr
    volumes:
      # This auto-imports .sql on first run
      - ./db/init:/docker-entrypoint-initdb.d
      # Our DB
      - dbdata:/var/lib/mysql
    ports:
      - "3306:3306"

volumes:
  dbdata:
  caddy_data:
  caddy_config:

