Skip to content

Instantly share code, notes, and snippets.

@strus38
Created November 14, 2018 10:25
Show Gist options
  • Save strus38/3f7bfbc13e4a4a912f9c7d8cdf3e7609 to your computer and use it in GitHub Desktop.
Save strus38/3f7bfbc13e4a4a912f9c7d8cdf3e7609 to your computer and use it in GitHub Desktop.
version: '2.1'
services:
gitlab:
image: gitlab/gitlab-ce:${GITLAB_CE_VERSION}
restart: always
container_name: gitlab
hostname: "${GITLAB_HOST}"
environment:
- TZ=${TZ}
- VIRTUAL_HOST=${GITLAB_HOST},${REGISTRY_HOST}
- VIRTUAL_PORT=80
- LETSENCRYPT_HOST=${GITLAB_HOST},${REGISTRY_HOST}
- LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
ports:
- ${GITLAB_SSH_IP}:${GITLAB_SSH_PORT}:22
volumes:
- './volumes/config:/etc/gitlab'
- './volumes/logs:/var/log/gitlab'
- './volumes/data:/var/opt/gitlab'
depends_on:
- redis
- postgres
networks:
- default
- nginx_proxy
pages:
image: gitlab/gitlab-ce:${GITLAB_CE_VERSION}
restart: always
container_name: gitlab_pages
hostname: "${PAGES_HOST}"
environment:
- TZ=${TZ}
- VIRTUAL_HOST=${PAGES_HOST},*.${PAGES_HOST}
- VIRTUAL_PORT=8090
- HTTPS_METHOD=nohttps
# - LETSENCRYPT_HOST=${PAGES_HOST}
# - LETSENCRYPT_EMAIL=${LETSENCRYPT_EMAIL}
expose:
- 8090/tcp
entrypoint:
- /opt/gitlab/embedded/bin/gitlab-pages
command:
- -listen-proxy
- "0.0.0.0:8090"
- -pages-domain
- "${PAGES_HOST}"
- -pages-root
- "/var/opt/gitlab/gitlab-rails/shared/pages"
volumes:
- './volumes/data/gitlab-pages:/var/opt/gitlab/gitlab-pages:rw'
- './volumes/data/gitlab-rails/shared/pages:/var/opt/gitlab/gitlab-rails/shared/pages:ro'
networks:
- nginx_proxy
runner:
image: gitlab/gitlab-runner:${GITLAB_RUNNER_VERSION}
restart: always
container_name: gitlab_runner
environment:
- CI_SERVER_URL=https://${GITLAB_HOST}/
volumes:
- ./volumes/runner:/etc/gitlab-runner
- /var/run/docker.sock:/var/run/docker.sock:rw
postgres:
image: postgres:${POSTGRES_VERSION}
restart: always
container_name: gitlab_postgresql
# https://github.com/docker-library/docs/tree/master/postgres#environment-variables
environment:
- POSTGRES_USER=gitlab
- POSTGRES_DB=gitlabhq_production
volumes:
- ./volumes/postgres:/var/lib/postgresql/data
restart: always
redis:
image: redis:${REDIS_VERSION}
restart: always
container_name: gitlab_redis
command:
- --loglevel warning
volumes:
- ./volumes/redis:/var/lib/redis
restart: always
networks:
nginx_proxy:
external:
name: ${NGINX_PROXY_NETWORK_NAME}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment