sameersbn / docker-gitlab

Dockerized GitLab
http://www.damagehead.com/docker-gitlab/
MIT License
7.9k stars 2.14k forks source link

Connection error #1518

Open zerr0s opened 6 years ago

zerr0s commented 6 years ago

Hello,

I'm trying to spawn your gitlab dock. When I execute docker-compose, postgesql and redis are running well, but gitlab throw me this error:

gitlab_1      | + gitlab_configure_database
gitlab_1      | + echo -n 'Configuring gitlab::database'
gitlab_1      | + gitlab_finalize_database_parameters
gitlab_1      | + [[ -n '' ]]
gitlab_1      | + [[ -n '' ]]
gitlab_1      | + [[ -z '' ]]
gitlab_1      | + echo
gitlab_1      | + echo 'ERROR: '
gitlab_1      | + echo '  Please configure the database connection.'
gitlab_1      | + echo '  Refer http://git.io/wkYhyA for more information.'
gitlab_1      | + echo '  Cannot continue without a database. Aborting...'
gitlab_1      | + echo
gitlab_1      | + return 1
gitlab_1      | Configuring gitlab::database
gitlab_1      | ERROR: 
gitlab_1      |   Please configure the database connection.
gitlab_1      |   Refer http://git.io/wkYhyA for more information.
gitlab_1      |   Cannot continue without a database. Aborting...

My docker-compose.yml:

version: "2"

services:
  postgresql:
    image: sameersbn/postgresql:9.6-2
    restart: always
    hostname: gitlabdb
    volumes:
      - ./data/db:/var/lib/postgresql
    environment:
      - DB_USER=gitlab
      - DB_PASS=xxxxx
      - DB_NAME=gitlab

  redis:
    image: sameersbn/redis:latest
    restart: always
    hostname: gitlabredis
    volumes:
      - ./data/redis:/var/lib/redis

  gitlab:
    image: sameersbn/gitlab:10.4.2-1
    restart: always
    hostname: gitlab
    restart: always
    depends_on:
      - redis
      - postgresql
    links:
      - redis:redisio
      - postgresql:postgresql
    ports:
      - "8080:80"
      - "10443:443"
      - "10022:22"
    volumes:
      - ./data/gitlab:/home/git/data
    environment:
      - DEBUG=true
      - DB_NAME=gitlab
      - DB_USER=gitlab
      - DB_PASS=xxxxx
      - GITLAB_SECRETS_DB_KEY_BASE=xxx
      - GITLAB_SECRETS_SECRET_KEY_BASE=xxxx
      - GITLAB_TIMEZONE=Paris
      - GITLAB_ROOT_PASSWORD=xxxx
      - GITLAB_ROOT_EMAIL=xxxx@xxx.xxx
      - GITLAB_EMAIL_DISPLAY_NAME="GitLab"
      - GITLAB_EMAIL_ENABLED=true
      - GITLAB_SIGNUP_ENABLED=false
      - GITLAB_BACKUP_DIR=/home/git/data/backups
      - GITLAB_BACKUP_SCHEDULE=daily
      - GITLAB_BACKUP_TIME=01:00
      - GITLAB_SSH_HOST=git.xxxxx.xxx
      - GITLAB_SSH_PORT=10022
      - GITLAB_HTTPS=true
      - SSL_CERTIFICATE_PATH=/home/git/data/certs/gitlab.crt
      - SSL_KEY_PATH=/home/git/data/certs/gitlab.key
      - SSL_DHPARAM_PATH=/home/git/data/certs/dhparam.pem
      - SMTP_ENABLED=true
      - SMTP_HOST=smtp.gmail.com
      - SMTP_PORT=587
      - SMTP_USER=xxxxxx@xxx.xx
      - SMTP_PASS=xxxxxxx
      - SMTP_STARTTLS=true
      - SMTP_AUTHENTICATION=login

What am I doing wrong ?

zerr0s commented 6 years ago

if i run docker run commands directly to create database, redis and gitlab docks, it seems to work. an issue with my docker-compose version ??

# docker-compose --version
docker-compose version 1.8.0, build unknown

EDIT: Same issue with the last version: docker-compose version 1.19.0, build 9e633ef

nixel2007 commented 6 years ago

Why do you set up host name for postgres?

zerr0s commented 6 years ago

No, in the doc:

If a postgresql container is linked, only the DB_ADAPTER, DB_HOST and DB_PORT settings are automatically retrieved using the linkage. You may still need to set other database connection parameters such as the DB_NAME, DB_USER, DB_PASS and so on.

I've just added DB_HOST, DB_ADAPTER and REDIS_HOST and gitlab starts. Something is weird...

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had any activity for the last 60 days. It will be closed if no further activity occurs during the next 7 days. Thank you for your contributions.