-
-
Save yasirsharif/74542057bc0ca37b03c770337f98daa6 to your computer and use it in GitHub Desktop.
Running GitLab Container with podman and systemd
This file contains 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
IMAGE=docker.io/gitlab/gitlab-ce:12.2.0-ce.0 | |
HOSTNAME=gitlab.pichuang.local | |
NAME=gitlab-ce |
This file contains 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
[Unit] | |
Description=GitLab Podman container | |
After=network.target | |
[Service] | |
Type=simple | |
TimeoutStartSec=5m | |
Restart=always | |
RestartSec=30s | |
EnvironmentFile=/etc/sysconfig/gitlab | |
ExecStartPre=-/usr/bin/podman rm ${NAME} | |
ExecStart=/usr/bin/podman run \ | |
--name ${NAME} \ | |
--hostname ${HOSTNAME} \ | |
--publish 443:443 \ | |
--publish 80:80 \ | |
--publish 8022:22 \ | |
--volume /srv/gitlab/config:/etc/gitlab:Z \ | |
--volume /srv/gitlab/logs:/var/log/gitlab:Z \ | |
--volume /srv/gitlab/data:/var/opt/gitlab:Z \ | |
${IMAGE} | |
ExecReload=-/usr/bin/podman stop ${NAME} | |
ExecReload=-/usr/bin/podman rm ${NAME} | |
ExecStop=-/usr/bin/podman stop ${NAME} | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment