ello, I have the following problem on docker 18.06.1-ce. I have an owncloud container that works with the following configurations:
- Image : owncloud/server:10.0
- Status healthy
- Ports : 0.0.0.0:4090->80/tcp, 0.0.0.0:4093->443/tcp
So far, so good, this container is functional.
Now, I want to add a gitlab container with the following configurations:
- Image : gitlab/gitlab-ce:latest
- Status : heatly
- Ports : 0.0.0.0:2222->22/tcp, 0.0.0.0:8080->80/tcp, 0.0.0.0:4443->443/tcp
The problem is that I can’t access the containers with the ports listed above (connection failed). I tried to install the container in a different way:
docker run --detach --hostname nsXXXXX.ip-XX-XXX-XX.eu \
--env GITLAB_OMNIBUS_CONFIG="external_url 'https://nsXXXXX.ip-XX-XXX-XX.eu:4443'; gitlab_rails['lfs_enabled'] = true;" \
--publish 4443:443 --publish 8080:80 --publish 2222:22 \
--name gitlab --restart always \
--volume /srv/gitlab/config:/etc/gitlab --volume /srv/gitlab/logs:/var/log/gitlab --volume /srv/gitlab/data:/var/opt/gitlab \
gitlab/gitlab-ce:latest
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'nsXXXXXXX.ip-XX-XXX-XX.eu'
privileged: true
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'https://nsXXXXXXX.ip-XX-XXX-XX.eu:4443/'
gitlab_rails['gitlab_shell_ssh_port'] = 4182
ports:
- '4180:80'
- '4443:443'
- '4182:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'`
My docker is on a dedicated Debain Stretch hosted by kimsufi.
Do you have any ideas to help me? Thank you very much.
Hello,
I’m test curl with http://localhost:50080. It works.
But :
In that case, you can try to assign the same port to the host, when creating the container:
Ex:
ports:
- ' 50080: 50080'
- '4443: 443'
- '4182: 22'
2 Likes
Okay, so my file looks like this:
version: '3'
services:
gitlab:
image: gitlab/gitlab-ce:latest
container_name: GitLab
hostname: 'nsXXXXXX.ip-XX-XXX-XX.eu'
restart: always
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://nsXXXX.ip-XX-XXX-XX.eu:50080'
gitlab_rails['time_zone'] = 'Europe/Brussels'
gitlab_rails['gitlab_email_from'] = 'gitlab-no-reply@srv-gitlab.com'
gitlab_rails['gitlab_email_display_name'] = 'GitLab Administrator'
gitlab_rails['gitlab_email_reply_to'] = 'XXXXXX'
gitlab_rails['backup_keep_time'] = 14515200
gitlab_rails['smtp_enable'] = true
gitlab_rails['smtp_address'] = "XXXXXXXX"
gitlab_rails['smtp_port'] = 587
gitlab_rails['smtp_user_name'] = "XXXXXXXXX"
gitlab_rails['smtp_password'] = "XXXXXXXXX"
gitlab_rails['smtp_domain'] = "XXXXXX"
gitlab_rails['smtp_authentication'] = "login"
gitlab_rails['smtp_enable_starttls_auto'] = true
unicorn['worker_timeout'] = 60
unicorn['worker_processes'] = 3
logging['logrotate_frequency'] = "weekly"
logging['logrotate_rotate'] = 52
logging['logrotate_compress'] = "compress"
logging['logrotate_method'] = "copytruncate"
logging['logrotate_delaycompress'] = "delaycompress"
# Add any other gitlab.rb configuration options if desired
ports:
- '50080:50080'
- '50443:443'
- '50022:22'
volumes:
- '/srv/gitlab/config:/etc/gitlab'
- '/srv/gitlab/logs:/var/log/gitlab'
- '/srv/gitlab/data:/var/opt/gitlab'
But dock worker indicates on my container:
80/tcp, 0.0.0.0:50080->50080/tcp, 0.0.0.0:50022->22/tcp, 0.0.0.0:50443->443/tcp
EDIT:
It works! It works!
But why don’t we map to port 80?
And I have to do the same for port 443 to get the ssl?
What about port 22?