Answer the question
In order to leave comments, you need to log in
How to link gitlab and nginx containers?
there is docker-compose.yml:
version: '3'
services:
php:
container_name: "php"
build: ./php/
expose:
- "9000"
ports:
- "9000:9000"
links:
- mysql
- memcached
- adminer
volumes:
- ./www:/var/www
- ./php:/usr/local/etc/php
restart: always
nginx:
restart: always
image: nginx:latest
ports:
- "80:80"
- "443:443"
volumes:
- ./hosts:/etc/nginx/conf.d
- ./www:/var/www
- ./logs:/var/log/nginx
depends_on:
- php
- gitlab
links:
- php
- gitlab:gitlab
mysql:
restart: always
image: mysql
ports:
- "3306:3306"
volumes:
- ./mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: root
adminer:
image: adminer
restart: always
ports:
- 8080:8080
links:
- mysql
memcached:
image: memcached
expose:
- "11211"
ports:
- "11211:11211"
restart: always
gitlab:
restart: always
container_name: "gitlab"
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'gitlab.loc'
environment:
GITLAB_OMNIBUS_CONFIG: |
gitlab_rails['gitlab_shell_ssh_port']=22;
ports:
- '0.0.0.0:32781:80'
- '4430:443'
- '22:22'
volumes:
- './gitlab/config:/etc/gitlab'
- './gitlab/logs:/var/log/gitlab'
- './gitlab/data:/var/opt/gitlab'
expose:
- "8091"
server {
listen 80;
server_name gitlab.loc;
error_log /var/log/nginx/nginx_error.log;
access_log /var/log/nginx/nginx_access.log;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $http_host;
proxy_pass http://localhost:32781;
}
}
Answer the question
In order to leave comments, you need to log in
proxy_pass http://gitlab.loc:32781
At the same time, from the machine on which the nginx server is running - everything should open at the address above.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question