Files
samba/docker-compose.yml
Struchkov Mark ff90440e32 Refactor codebase for better maintainability
- samba.sh: Add SMB_CONF constant, create set_config_option() to reduce
  duplication, replace deprecated egrep with grep -E, improve quoting
- Dockerfile: Replace multiple echo commands with heredoc for readability,
  separate logical build stages
- docker-compose.yml: Add healthcheck, improve formatting
- .dockerignore: Extend exclusion list

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-07 16:29:18 +03:00

52 lines
1.1 KiB
YAML

services:
samba:
image: docker.struchkov.dev/samba
restart: unless-stopped
environment:
TZ: 'EST5EDT'
# Use environment variables for shares and users instead of command line
# SHARE: "Mount;/mnt"
# SHARE2: "Bobs Volume;/mnt2;yes;no;no;bob"
# USER: "bob;${SAMBA_BOB_PASSWORD}"
# PERMISSIONS: "true"
env_file:
- .env # Put sensitive data like passwords here
ports:
- "137:137/udp"
- "138:138/udp"
- "139:139/tcp"
- "445:445/tcp"
volumes:
- /mnt:/mnt:z
- /mnt2:/mnt2:z
read_only: true
tmpfs:
- /tmp
stdin_open: true
tty: true
healthcheck:
test: ["CMD", "smbclient", "-L", "\\\\localhost", "-U", "%", "-m", "SMB3"]
interval: 60s
timeout: 15s
start_period: 10s
retries: 3
deploy:
resources:
limits:
memory: 512M
reservations:
memory: 128M
command: '-s "Mount;/mnt" -s "Bobs Volume;/mnt2;yes;no;no;bob" -u "bob;${SAMBA_BOB_PASSWORD:-changeme}" -p'
networks:
default: