- Replace deprecated MAINTAINER with LABEL and add OCI metadata - Pin Alpine version via ARG for reproducible builds - Fix command injection vulnerability by replacing eval with safe parser - Modernize docker-compose: remove version, add resource limits - Move passwords to environment variables instead of hardcoded values - Improve healthcheck with start-period and retries - Add .env.example template and update .gitignore 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
39 lines
928 B
YAML
39 lines
928 B
YAML
services:
|
|
samba:
|
|
image: docker.struchkov.dev/samba
|
|
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
|
|
networks:
|
|
- default
|
|
ports:
|
|
- "137:137/udp"
|
|
- "138:138/udp"
|
|
- "139:139/tcp"
|
|
- "445:445/tcp"
|
|
read_only: true
|
|
tmpfs:
|
|
- /tmp
|
|
restart: unless-stopped
|
|
stdin_open: true
|
|
tty: true
|
|
volumes:
|
|
- /mnt:/mnt:z
|
|
- /mnt2:/mnt2:z
|
|
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:
|