Skip to content

Instantly share code, notes, and snippets.

@yasirsharif
Forked from pichuang/etc_sysconfig_gitlab
Created December 18, 2021 12:31
Show Gist options
  • Save yasirsharif/74542057bc0ca37b03c770337f98daa6 to your computer and use it in GitHub Desktop.
Save yasirsharif/74542057bc0ca37b03c770337f98daa6 to your computer and use it in GitHub Desktop.
Running GitLab Container with podman and systemd
IMAGE=docker.io/gitlab/gitlab-ce:12.2.0-ce.0
HOSTNAME=gitlab.pichuang.local
NAME=gitlab-ce
[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