Skip to content

Instantly share code, notes, and snippets.

@pdxjohnny
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pdxjohnny/c8c0884e56168fe69c44 to your computer and use it in GitHub Desktop.
Save pdxjohnny/c8c0884e56168fe69c44 to your computer and use it in GitHub Desktop.
Docker gitlab scripts
postgresql:
image: sameersbn/postgresql:9.4
environment:
- DB_USER=gitlab
- DB_PASS=password
- DB_NAME=gitlabhq_production
volumes:
- /srv/docker/gitlab/postgresql:/var/lib/postgresql
gitlab:
image: sameersbn/gitlab:7.11.3
links:
- redis:redisio
- postgresql:postgresql
ports:
- "10080:80"
- "10022:22"
environment:
- TZ=Asia/Kolkata
- SMTP_ENABLED=false
- SMTP_DOMAIN=www.example.com
- SMTP_HOST=smtp.gmail.com
- SMTP_PORT=587
- SMTP_USER=mailer@example.com
- SMTP_PASS=password
- SMTP_STARTTLS=true
- SMTP_AUTHENTICATION=login
- GITLAB_TIMEZONE=Kolkata
- GITLAB_HOST=localhost
- GITLAB_PORT=10080
- GITLAB_SSH_PORT=10022
- GITLAB_EMAIL=admin@example.com
- GITLAB_EMAIL_REPLY_TO=noreply@example.com
- GITLAB_BACKUPS=daily
- GITLAB_BACKUP_TIME=01:00
volumes:
- /srv/docker/gitlab/gitlab:/home/git/data
redis:
image: sameersbn/redis:latest
volumes:
- /srv/docker/gitlab/redis:/var/lib/redis
#! /bin/sh
# /etc/init.d/docker-gitlab
#
case "$1" in
start)
echo "Starting docker gitlab..."
docker start gitlab_postgresql_1 gitlab_redis_1 gitlab_gitlab_1
;;
stop)
echo "Stoping docker gitlab..."
docker stop gitlab_postgresql_1 gitlab_redis_1 gitlab_gitlab_1
;;
*)
echo "Usage: sudo service docker-gitlab {start|stop}"
exit 1
;;
esac
exit 0
#!/bin/bash
# Run as root
NAME="docker-gitlab"
docker-compose up
cp ./${NAME} /etc/init.d/${NAME}
chmod 774 /etc/init.d/${NAME}
update-rc.d ${NAME} defaults 99 01
# To restore a backup
# docker run --name=gitlab --link gitlab_postgresql_1:postgresql --link gitlab_redis_1:redisio -v /srv/docker/gitlab/gitlab:/home/git/data -it --rm sameersbn/gitlab:7.11.3 app:rake gitlab:backup:restore
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment