services:
  samba:
    image: ghcr.io/servercontainers/samba:latest
    container_name: samba
    network_mode: host
    environment:
      SAMBA_WORKGROUP: WORKGROUP
      # Create one example user "user" with password "password"
      ACCOUNT_user: password
      # One example share named "Share" mapping to /data
      SAMBA_VOLUME_CONFIG: |
        Share;/data;yes;no;no;user
    volumes:
      - ./data:/data:rw
      - "/run/media/Messier82/Bread/Фотографии":./Photos:rw
      - samba_etc:/etc/samba
      - samba_lib:/var/lib/samba
      - samba_cache:/var/cache/samba
    restart: unless-stopped

  webmin:
    image: coderitter/webmin:latest
    container_name: webmin
    network_mode: host
    # Mount the SAME samba paths so Webmin’s Samba module edits the real files
    volumes:
      - samba_etc:/etc/samba
      - samba_lib:/var/lib/samba
    environment:
      # Optional: set Webmin admin user/password the first time
      WEBMIN_INIT_SETUP: "1"
      WEBMIN_ROOT: "admin"
      WEBMIN_PASS: "changeme"
    restart: unless-stopped

volumes:
  samba_etc:
  samba_lib:
  samba_cache:

