Sorry if this is a duplicate question––I found similar issues but none seemed to be my exact use case… If I missed something mentioning a link would be highly appreciated.
I am trying to compose a docker stack with frontproxy, acme-companion and gitlab.
Currently, I am using a setup with several docker-compose.yml files for frontproxy and gitlab, in separate directories––which is working, without acme-companion.
My attempt to integrate it all into one file fails so far; obviously I am messing up the GITLAB_OMNIBUS_CONFIG
configs––I just don’t understand where my error is.
version: '3.1'
services:
frontproxy:
restart: always
image: jwilder/nginx-proxy
labels:
- "com.github.jrcs.letsencrypt_nginx_proxy_companion.nginx"
ports:
- "80:80"
- "443:443"
volumes:
- "/var/run/docker.sock:/tmp/docker.sock:ro"
- "certs-volume:/etc/nginx/certs:ro"
- "/etc/nginx/vhost.d"
- "/usr/share/nginx/html"
nginx-letsencrypt-companion:
restart: always
image: nginxproxy/acme-companion
volumes:
- "certs-volume:/etc/nginx/certs"
- "/var/run/docker.sock:/var/run/docker.sock:ro"
gitlab:
image: gitlab/gitlab-ce:latest
restart: always
hostname: 'dev.redacted.com'
environment:
VIRTUAL_HOST: 'dev.redacted.com'
LETSENCRYPT_HOST: 'dev.redacted.com'
LETSENCRYPT_EMAIL: '[email protected]'
VIRTUAL_PROTO: 'https'
VIRTUAL_PORT: '443'
CERT_NAME: 'redacted.com'
GITLAB_OMNIBUS_CONFIG: |
# Email setup
gitlab_rails['gitlab_email_enabled'] = true
gitlab_rails['gitlab_email_from'] = '[email protected]'
gitlab_rails['gitlab_email_display_name'] = '[email protected]'
gitlab_rails['gitlab_email_reply_to'] = '[email protected]'
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = 'mail.redacted.com'
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = '[email protected]'
gitlab_rails['smtp_password'] = 'redacted'
gitlab_rails['smtp_domain'] = 'redacted.com'
gitlab_rails['smtp_authentication'] = 'login'
gitlab_rails['smtp_enable_starttls_auto'] = true
gitlab_rails['gitlab_root_email'] = '[email protected]'
# HTTPS Setup
letsencrypt['enable'] = false
external_url 'https://dev.redacted.com'
gitlab_rails['gitlab_https'] = true
gitlab_rails['gitlab_port'] = 443
ports:
- '22:22'
volumes:
- ./config:/etc/gitlab
- ./logs:/var/log/gitlab
- ./data:/var/opt/gitlab
volumes:
certs-volume:
Edit:
I had not specified the error I was seeing–thanks for pointing it out, @sytech!
So, here’s the exact error message, when trying to start the stack with docker-compose up -d
:
ERROR: yaml.parser.ParserError: while parsing a block mapping
in "./docker-compose.yml", line 29, column 7
expected <block end>, but found '<scalar>'
in "./docker-compose.yml", line 38, column 9
2
Answers
Although I have not been able to figure out the specific problem I had with the
docker-compose.yml
with version 3.1. I managed to compose one that works now for me though––perhaps it's useful to others as well:I’ve been experiencing the same issue.
When I use the GITLAB_OMNIBUS_CONFIG environment variable, these settings do not appear to apply. If I copy just one of the settings that is easily identifiable into the gitlab.rb configuration, it applies just fine.
This is the environment variable as it is present in the container:
Yet, if I add the SSH port option to the gitlab.rb and reconfigure, I will see it in the clone address. So, while I am not using the composition method, I am launching the container with ‘podman run’ and passing options like those described in the docker guide for gitlab.