Jenkins에서 GitLab프로젝트 배포

GIT/JENKINS/NEXUS 연동 DOCKER-COMPOSE

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: '3.5'
services:
web:
image: 'gitlab/gitlab-ce:latest'
restart: always
hostname: 'localhost'
container_name: gitlab
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url 'http://127.0.0.1'
gitlab_rails['gitlab_shell_ssh_port'] = 5000
ports:
- '8080:80'
- '5000:22'
volumes:
- './gitlab/config:/etc/gitlab'
- './gitlab/logs:/var/log/gitlab'
- './gitlab/data:/var/opt/gitlab'
- './gitlab/backup:/var/opt/gitlab/backups' # 백업 폴더 추가
networks:
- gitlab

gitlab-runner:
image: 'gitlab/gitlab-runner:alpine'
container_name: gitlab-runner
restart: always
user: root
depends_on:
- web
volumes:
- '/var/run/docker.sock:/var/run/docker.sock'
- './gitlab-runner:/etc/gitlab-runner'
networks:
- gitlab

nexus:
image: 'sonatype/nexus3:latest'
container_name: nexus
user: root
ports:
- "8081:8081"
networks:
- devnet
volumes:
- "./nexus:/var/nexus-home"
environment:
TZ: 'Asia/Seoul'

jenkins:
image: 'jenkins/jenkins:latest'
container_name: jenkins
user: root
ports:
- "8082:8080"
networks:
- devnet
volumes:
- "./jenkins:/var/jenkins_home"
environment:
TZ: 'Asia/Seoul'

networks:
devnet:
driver: bridge
gitlab:
name: gitlab-network
1
$ docker-compose up