Skip to content

Instantly share code, notes, and snippets.

@anvie
Last active December 21, 2022 05:50
Show Gist options
  • Save anvie/e3fd2cb1bd65d1d4bd6cb59a4c1abbd9 to your computer and use it in GitHub Desktop.
Save anvie/e3fd2cb1bd65d1d4bd6cb59a4c1abbd9 to your computer and use it in GitHub Desktop.
Systemd untuk mongodb
[Unit]
Description=Mongodb Service Container
After=docker.service
Requires=docker.service
[Service]
Type=simple
Restart=always
RestartSec=5
StartLimitBurst=5
LimitNOFILE=10000
User=mongodb
ExecStartPre=-/usr/bin/docker stop mongodb
ExecStartPre=-/usr/bin/docker rm mongodb
ExecStart=/usr/bin/docker run --rm --user 1001 -v '/var/data/mongodb:/bitnami/mongodb' -p '27017:27017' --name mongodb bitnami/mongodb:latest
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment