[Unit]
Description=Local Docker Registry for food-market
Requires=docker.service
After=docker.service network-online.target

[Service]
Type=simple
ExecStartPre=-/usr/bin/docker rm -f food-market-registry
ExecStart=/usr/bin/docker run --rm --name food-market-registry \
  -p 127.0.0.1:5001:5000 \
  -v /opt/food-market-data/docker-registry:/var/lib/registry \
  -e REGISTRY_STORAGE_DELETE_ENABLED=true \
  registry:2
ExecStop=/usr/bin/docker stop food-market-registry
Restart=on-failure
RestartSec=5

[Install]
WantedBy=multi-user.target
