docker-gitlab: problem with logging in the gitlab container

I get gitlab_1 | WARNING: no logs are available with the ‘journald’ log driver and later I get ci_gitlab_1 exited with code 1

the redis and pg containers seem to log properly.

Im using docker-compose, and it is problematic restarting the stack, and it seems I cant get logs either…

this is the compose file

postgresql:
  image: quay.io/sameersbn/postgresql:9.4-5
  environment:
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production
  volumes:
    - ./data/gitlab/postgresql:/var/lib/postgresql
redis:
  image: quay.io/sameersbn/redis:latest
  volumes:
    - ./data/gitlab/redis:/var/lib/redis

gitlab:
  image: quay.io/sameersbn/gitlab:8.1.2
  links:
    - redis:redisio
    - postgresql:postgresql
  ports:
    - "50003:80"
    - "50004:22"
  environment:
    - TZ=Europe/Stockholm
    - GITLAB_TIMEZONE=Stockholm

    - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string

    - GITLAB_HOST=localhost
    - GITLAB_PORT=50003
    - GITLAB_SSH_PORT=50004

    - GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
    - GITLAB_NOTIFY_PUSHER=false

    - GITLAB_EMAIL=notifications@example.com
    - GITLAB_EMAIL_REPLY_TO=noreply@example.com
    - GITLAB_INCOMING_EMAIL_ADDRESS=reply@example.com

    - GITLAB_BACKUPS=daily
    - GITLAB_BACKUP_TIME=01:00

    - SMTP_ENABLED=true
    - SMTP_DOMAIN=verona.se
    - SMTP_HOST=127.0.0.1
    - SMTP_PORT=587
#    - SMTP_USER=mailer@example.com
#    - SMTP_PASS=password
#    - SMTP_STARTTLS=true
#    - SMTP_AUTHENTICATION=login

    - IMAP_ENABLED=false
    - IMAP_HOST=imap.gmail.com
    - IMAP_PORT=993
    - IMAP_USER=mailer@example.com
    - IMAP_PASS=password
    - IMAP_SSL=true
    - IMAP_STARTTLS=false
    - DEBUG_ENTRYPOINT=true
  volumes:
    - ./data/gitlab/gitlab:/home/git/data

About this issue

  • Original URL
  • State: closed
  • Created 9 years ago
  • Comments: 23 (7 by maintainers)

Most upvoted comments

I have a solution now, which sucks, but it works.

  • I had to export both the redis port and the postgres port to the host
  • I had to use the external postgres/redis conf options, except redis and pg are running in containers rather than being external
  • I also had to chown the gitlab repo dir, for some reason. they were owned by root. Im not sure why that happened.

heres the working compose file. 10.0.75.24 is the ip of the host.

postgresql:
  log_driver: "json-file"
  image: quay.io/sameersbn/postgresql:9.4-5
  ports:
    - "50005:5432"  
  environment:
    - DB_USER=gitlab
    - DB_PASS=password
    - DB_NAME=gitlabhq_production
  volumes:
    - ./data/gitlab/postgresql:/var/lib/postgresql
redis:
  log_driver: "json-file"  
  image: quay.io/sameersbn/redis:latest
  volumes:
    - ./data/gitlab/redis:/var/lib/redis
  ports:
    - "50006:6379"  

gitlab:
  log_driver: "json-file"  
  image: quay.io/sameersbn/gitlab:8.1.2
  links:
    - redis:redisio
    - postgresql:postgresql
  ports:
    - "50003:80"
    - "50004:22"
  environment:
    - REDIS_HOST=10.0.75.24
    - REDIS_PORT=50006
    - DB_TYPE=postgres
    - DB_HOST=10.0.75.24
    - DB_PORT=50005
    - TZ=Europe/Stockholm
    - GITLAB_TIMEZONE=Stockholm

    - GITLAB_SECRETS_DB_KEY_BASE=long-and-random-alphanumeric-string

    - GITLAB_HOST=localhost
    - GITLAB_PORT=50003
    - GITLAB_SSH_PORT=50004

    - GITLAB_NOTIFY_ON_BROKEN_BUILDS=true
    - GITLAB_NOTIFY_PUSHER=false

    - GITLAB_EMAIL=notifications@example.com
    - GITLAB_EMAIL_REPLY_TO=noreply@example.com
    - GITLAB_INCOMING_EMAIL_ADDRESS=reply@example.com

    - GITLAB_BACKUPS=daily
    - GITLAB_BACKUP_TIME=01:00

    - SMTP_ENABLED=true
    - SMTP_DOMAIN=nwise.se
    - SMTP_HOST=127.0.0.1
    - SMTP_PORT=587
#    - SMTP_USER=mailer@example.com
#    - SMTP_PASS=password
#    - SMTP_STARTTLS=true
#    - SMTP_AUTHENTICATION=login

    - IMAP_ENABLED=false
    - IMAP_HOST=imap.gmail.com
    - IMAP_PORT=993
    - IMAP_USER=mailer@example.com
    - IMAP_PASS=password
    - IMAP_SSL=true
    - IMAP_STARTTLS=false
    - DEBUG_ENTRYPOINT=true
  volumes:
    - ./data/gitlab/gitlab:/home/git/data