*How can I run gitlab locally using docker-compose on macOS?
I have tried different flavours of the docker-compose provided by git lab:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.example.com'
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://gitlab.example.com'
# Add any other gitlab.rb configuration here, each on its own line
ports:
- '80:80'
- '443:443'
- '22:22'
volumes:
- './.git/gitlab/config:/etc/gitlab'
- './.git/gitlab/logs:/var/log/gitlab'
- './.git/gitlab/data:/var/opt/gitlab'
When I say different flavours is that I tried both with ee and ce editions as well as different versions. latest and 13.6.5
However it is always failing due to the following error message:
web_1 | Running handlers: web_1 | There was an error running gitlab-ctl reconfigure: web_1 | web_1 | bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1' web_1 | ---- Begin output of "bash" "/tmp/chef-script20210114-36-w3p5hn" ---- web_1 | STDOUT: rake aborted! web_1 | PG::ConnectionBad: could not connect to server: No such file or directory web_1 | Is the server running locally and accepting web_1 | connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"? web_1 | /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:58:in `block (3 levels) in <top (required)>' web_1 | /opt/gitlab/embedded/bin/bundle:23:in `load' web_1 | /opt/gitlab/embedded/bin/bundle:23:in `<main>' web_1 | Tasks: TOP => gitlab:db:configure web_1 | (See full trace by running task with --trace) web_1 | STDERR: web_1 | ---- End output of "bash" "/tmp/chef-script20210114-36-w3p5hn" ---- web_1 | Ran "bash" "/tmp/chef-script20210114-36-w3p5hn" returned 1 web_1 |
From what I read from the documentation, the postgres is already bundled and no configuration is needed. However it seems it can not connect to Postgres
Some context:
I’m building a piece of software that will interact with gitlab rest API. And I want to have a running gitlab on my machine in order to run tests against it. The sw will make get requests to projects, commits, pipelines, jobs, etc. So for testing I need a gitlab where I can automatically create this resources in order to test my sw.
Thank you.