Created
April 19, 2023 02:12
-
-
Save aniongithub/c457dbd657da606d9ecb290182902bc4 to your computer and use it in GitHub Desktop.
Dockerfile using docker-systemctl-replacement and heredoc for unit file
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# syntax=docker/dockerfile:1.3-labs | |
# Enable heredoc syntax https://collabnix.com/using-heredocs-in-dockerfiles-simplify-your-image-building-process/ | |
FROM ubuntu | |
RUN wget https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl3.py -O /usr/local/bin/systemctl &&\ | |
chmod +x /usr/local/bin/systemctl | |
RUN cat <<EOF > /etc/systemd/system/memgraph.service | |
[Unit] | |
Description=Docker systemd service | |
DefaultDependencies=no | |
[Service] | |
Type=simple | |
WorkingDirectory=/working/directory/here | |
ExecStart=/command/to/execute/here --args-here | |
Restart=on-failure | |
RestartSec=5s | |
User=root | |
TimeoutSec=900 | |
[Install] | |
WantedBy=sysinit.target | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment