Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Dec 12, 2024. It is now read-only.
/devops-composePublic archive

Commitf2755c3

Browse files
committed
Improve domain name can be set via env
1 parent0ff0c47 commitf2755c3

File tree

6 files changed

+40
-28
lines changed

6 files changed

+40
-28
lines changed

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.env
2+
/docker-compose.override.yml

‎README.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Run containers on Docker Compose.
2121
This may take a few minutes.
2222

2323
```sh
24+
echo'REVERSE_PROXY_DOMAIN_NAME=example.com'>> .env
2425
docker-compose build
2526
docker-compose up -d
2627
```

‎docker-compose.yml‎

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,24 @@ services:
55
build:nginx
66
ports:
77
-"80:80"
8+
environment:
9+
REVERSE_PROXY_DOMAIN_NAME:${REVERSE_PROXY_DOMAIN_NAME}
810

911
jira:
1012
image:cptactionhank/atlassian-jira-software
1113
environment:
12-
X_PROXY_NAME:jira.example.com
13-
X_PROXY_PORT:443
14-
X_PROXY_SCHEME:https
14+
X_PROXY_NAME:jira.${REVERSE_PROXY_DOMAIN_NAME}
15+
X_PROXY_PORT:80
16+
X_PROXY_SCHEME:http
1517
volumes:
1618
-jira-data:/var/atlassian/jira
1719

1820
confluence:
1921
image:cptactionhank/atlassian-confluence
2022
environment:
21-
X_PROXY_NAME:confluence.example.com
22-
X_PROXY_PORT:443
23-
X_PROXY_SCHEME:https
23+
X_PROXY_NAME:confluence.${REVERSE_PROXY_DOMAIN_NAME}
24+
X_PROXY_PORT:80
25+
X_PROXY_SCHEME:http
2426
volumes:
2527
-confluence-data:/var/atlassian/confluence
2628

@@ -86,7 +88,7 @@ services:
8688
ldap:
8789
image:osixia/openldap
8890
environment:
89-
LDAP_DOMAIN:example.com
91+
LDAP_DOMAIN:${REVERSE_PROXY_DOMAIN_NAME}
9092
volumes:
9193
-ldap-data:/var/lib/ldap
9294
-ldap-config:/etc/ldap/slapd.d

‎nginx/Dockerfile‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
FROM nginx
2-
COPY index.html /etc/nginx/html/
3-
RUN rm /etc/nginx/conf.d/default.conf
4-
COPY nginx.conf /etc/nginx/conf.d/
2+
3+
COPY index.html /etc/nginx/html/index.html
4+
COPY nginx.conf /etc/nginx/conf.d/default.conf
5+
6+
CMD echo"REVERSE_PROXY_DOMAIN_NAME=$REVERSE_PROXY_DOMAIN_NAME" && \
7+
sed -e"s,REVERSE_PROXY_DOMAIN_NAME,$REVERSE_PROXY_DOMAIN_NAME,g" -i /etc/nginx/html/index.html && \
8+
sed -e"s,REVERSE_PROXY_DOMAIN_NAME,$REVERSE_PROXY_DOMAIN_NAME,g" -i /etc/nginx/conf.d/default.conf && \
9+
nginx -g'daemon off;'

‎nginx/index.html‎

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,17 @@
55
</head>
66
<body>
77

8+
<h1>DevOps Compose</h1>
9+
810
<ul>
9-
<li><ahref="//jira.example.com">JIRA</a></li>
10-
<li><ahref="//confluence.example.com">Confluence</a></li>
11-
<li><ahref="//jenkins.example.com">Jenkins</a></li>
12-
<li><ahref="//gitbucket.example.com">GitBucket</a></li>
13-
<li><ahref="//artifactory.example.com">Artifactory</a></li>
14-
<li><ahref="//sonarqube.example.com">SonarQube</a></li>
15-
<li><ahref="//owncloud.example.com">ownCloud</a></li>
16-
<li><ahref="//mattermost.example.com">Mattermost</a></li>
11+
<li><ahref="//jira.REVERSE_PROXY_DOMAIN_NAME">JIRA</a></li>
12+
<li><ahref="//confluence.REVERSE_PROXY_DOMAIN_NAME">Confluence</a></li>
13+
<li><ahref="//jenkins.REVERSE_PROXY_DOMAIN_NAME">Jenkins</a></li>
14+
<li><ahref="//gitbucket.REVERSE_PROXY_DOMAIN_NAME">GitBucket</a></li>
15+
<li><ahref="//artifactory.REVERSE_PROXY_DOMAIN_NAME">Artifactory</a></li>
16+
<li><ahref="//sonarqube.REVERSE_PROXY_DOMAIN_NAME">SonarQube</a></li>
17+
<li><ahref="//owncloud.REVERSE_PROXY_DOMAIN_NAME">ownCloud</a></li>
18+
<li><ahref="//mattermost.REVERSE_PROXY_DOMAIN_NAME">Mattermost</a></li>
1719
</ul>
1820

1921
</body>

‎nginx/nginx.conf‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ server {
1111
}
1212

1313
server{
14-
server_name jira.example.com;
14+
server_name jira.REVERSE_PROXY_DOMAIN_NAME;
1515
location /{
1616
proxy_passhttp://jira:8080;
1717
proxy_set_header Host$host;
@@ -24,7 +24,7 @@ server {
2424
}
2525

2626
server{
27-
server_name confluence.example.com;
27+
server_name confluence.REVERSE_PROXY_DOMAIN_NAME;
2828
location /{
2929
proxy_passhttp://confluence:8090;
3030
proxy_set_header Host$host;
@@ -50,7 +50,7 @@ server {
5050
}
5151

5252
server{
53-
server_name gitbucket.example.com;
53+
server_name gitbucket.REVERSE_PROXY_DOMAIN_NAME;
5454
location /{
5555
proxy_passhttp://gitbucket:8080;
5656
proxy_set_header Host$host;
@@ -67,7 +67,7 @@ server {
6767
}
6868

6969
server{
70-
server_name jenkins.example.com;
70+
server_name jenkins.REVERSE_PROXY_DOMAIN_NAME;
7171
location /{
7272
proxy_passhttp://jenkins:8080;
7373
proxy_set_header Host$host;
@@ -80,7 +80,7 @@ server {
8080
}
8181

8282
server{
83-
server_name artifactory.example.com;
83+
server_name artifactory.REVERSE_PROXY_DOMAIN_NAME;
8484
location /{
8585
proxy_passhttp://artifactory:8081;
8686
proxy_set_header Host$host;
@@ -93,17 +93,17 @@ server {
9393
}
9494

9595
server{
96-
server_name sonarqube.example.com;
96+
server_name sonarqube.REVERSE_PROXY_DOMAIN_NAME;
9797
location /{
9898
proxy_passhttp://sonarqube:9000;
9999
# SonarQube does not support X-FORWARDED headers and rewrite redirection
100-
proxy_redirecthttp://sonarqube:9000http://sonarqube.example.com;
101-
proxy_redirect https://sonarqube:9000 https://sonarqube.example.com;
100+
proxy_redirecthttp://sonarqube:9000http://sonarqube.REVERSE_PROXY_DOMAIN_NAME;
101+
proxy_redirect https://sonarqube:9000 https://sonarqube.REVERSE_PROXY_DOMAIN_NAME;
102102
}
103103
}
104104

105105
server{
106-
server_name owncloud.example.com;
106+
server_name owncloud.REVERSE_PROXY_DOMAIN_NAME;
107107
location /{
108108
proxy_passhttp://owncloud;
109109
proxy_set_header Host$host;
@@ -116,7 +116,7 @@ server {
116116
}
117117

118118
server{
119-
server_name mattermost.example.com;
119+
server_name mattermost.REVERSE_PROXY_DOMAIN_NAME;
120120
location /{
121121
proxy_passhttp://mattermost;
122122
proxy_set_header Host$host;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp