Skip to content

Commit 6e7140e

Browse files
Merge branch 'change-to-light-module'
2 parents c4057c2 + 7d5c47f commit 6e7140e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+203
-881
lines changed

.docker/nginx/Dockerfile

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,20 +14,14 @@ RUN if getent group $shared_volume_group_id ; then \
1414
groupadd -g $shared_volume_group_id $shared_volume_group_name && usermod -aG $shared_volume_group_name nginx; \
1515
fi
1616

17-
RUN wget --no-check-certificate https://releases.hashicorp.com/consul-template/0.19.3/consul-template_0.19.3_linux_amd64.zip && \
18-
unzip -d /usr/local/bin consul-template_0.19.3_linux_amd64.zip && \
19-
rm -rf consul-template_0.19.3_linux_amd64.zip
20-
2117
COPY ./.docker/nginx/template/entrypoint.sh /
2218
COPY ./.docker/nginx/template/nginx.service /etc/service/nginx/run/
23-
COPY ./.docker/nginx/template/consul-template.service /etc/service/consul-template/run/
2419

2520
COPY ./.docker/nginx/template/nginx.conf.main /etc/nginx/nginx.conf
26-
COPY ./.docker/nginx/template/ctmpl /ctmpl
21+
COPY ./.docker/nginx/template/conf.d /conf.d
2722
COPY ./.docker/nginx/template/logrotate/nginx /etc/logrotate.d/nginx
2823

29-
RUN chmod +x /etc/service/nginx/run && chmod +x /etc/service/consul-template/run
30-
RUN sed -i -e 's/\r$//' /etc/service/consul-template/run/consul-template.service
24+
RUN chmod +x /etc/service/nginx/run
3125
RUN sed -i -e 's/\r$//' /etc/service/nginx/run/nginx.service
3226
RUN rm /etc/nginx/conf.d/default.conf
3327

.docker/nginx/origin/conf.d/http/additionals/nginx.conf.ctmpl.origin

Lines changed: 0 additions & 34 deletions
This file was deleted.

.docker/nginx/origin/conf.d/http/app/nginx.conf.ctmpl.origin

Lines changed: 0 additions & 36 deletions
This file was deleted.

.docker/nginx/origin/conf.d/https/additionals/nginx.conf.ctmpl.origin

Lines changed: 0 additions & 43 deletions
This file was deleted.

.docker/nginx/origin/conf.d/https/app/nginx.conf.ctmpl.origin

Lines changed: 0 additions & 45 deletions
This file was deleted.

.docker/nginx/template/consul-template.service

Lines changed: 0 additions & 5 deletions
This file was deleted.

.docker/nginx/template/entrypoint.sh

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,18 @@ echo "[INSIDE_NGINX_CONTAINER][NOTICE] Start Logrotate (every hour at minute 1)
1717
service cron restart || echo "[WARN] Restarting Cron failed."
1818

1919

20-
# From this point on, the configuration of the NGINX consul-template begins.
21-
if [[ ! -d /etc/consul-templates ]]; then
22-
echo "[INSIDE_NGINX_CONTAINER][NOTICE] As the directory name '/etc/consul-templates' does NOT exist, it has been created."
23-
mkdir /etc/consul-templates
20+
# From this point on, the configuration of the NGINX template begins.
21+
if [[ ! -d /etc/templates ]]; then
22+
echo "[INSIDE_NGINX_CONTAINER][NOTICE] As the directory name '/etc/templates' does NOT exist, it has been created."
23+
mkdir /etc/templates
2424
fi
2525

2626
app_url=$(printenv APP_URL)
2727
protocol=$(echo ${app_url} | awk -F[/:] '{print $1}')
28-
echo "[INSIDE_NGINX_CONTAINER][NOTICE] Copy the template, contingency files for ${protocol} from '/ctmpl/${protocol}' to '/etc/consul-templates'."
28+
echo "[INSIDE_NGINX_CONTAINER][NOTICE] Copy the prepared files for ${protocol} from '/conf.d/${protocol}' to '/etc/templates'."
2929
sleep 2
30-
cp -f /ctmpl/${protocol}/nginx.conf.ctmpl /etc/consul-templates
31-
cp -f /ctmpl/${protocol}/nginx.conf.contingency.blue /etc/consul-templates
32-
cp -f /ctmpl/${protocol}/nginx.conf.contingency.green /etc/consul-templates
30+
cp -f /conf.d/${protocol}/nginx.conf.prepared.blue /etc/templates
31+
cp -f /conf.d/${protocol}/nginx.conf.prepared.green /etc/templates
3332

3433
# SSL
3534
if [[ ${protocol} = 'https' ]]; then
@@ -76,9 +75,8 @@ if [[ ${protocol} = 'https' ]]; then
7675
chmod 644 /etc/nginx/ssl/${commercial_ssl_name}.chained.crt
7776
chmod 644 /etc/nginx/ssl/${commercial_ssl_name}.crt
7877

79-
sed -i -e "s/!#{COMMERCIAL_SSL_NAME}/${commercial_ssl_name}/" /etc/consul-templates/nginx.conf.ctmpl || (echo "commercial_ssl_name (${commercial_ssl_name}) on .env failed to be applied. (ctmpl)" && exit 1)
80-
sed -i -e "s/!#{COMMERCIAL_SSL_NAME}/${commercial_ssl_name}/" /etc/consul-templates/nginx.conf.contingency.blue || (echo "commercial_ssl_name (${commercial_ssl_name}) on .env failed to be applied. (contingency blue)" && exit 1)
81-
sed -i -e "s/!#{COMMERCIAL_SSL_NAME}/${commercial_ssl_name}/" /etc/consul-templates/nginx.conf.contingency.green || (echo "commercial_ssl_name (${commercial_ssl_name}) on .env failed to be applied. (contingency green)" && exit 1)
78+
sed -i -e "s/!#{COMMERCIAL_SSL_NAME}/${commercial_ssl_name}/" /etc/templates/nginx.conf.prepared.blue || (echo "commercial_ssl_name (${commercial_ssl_name}) on .env failed to be applied. (prepared blue)" && exit 1)
79+
sed -i -e "s/!#{COMMERCIAL_SSL_NAME}/${commercial_ssl_name}/" /etc/templates/nginx.conf.prepared.green || (echo "commercial_ssl_name (${commercial_ssl_name}) on .env failed to be applied. (prepared green)" && exit 1)
8280
fi
8381

8482

@@ -104,7 +102,5 @@ for retry_count in {1..5}; do
104102
sleep 3
105103
done
106104

107-
echo "[INSIDE_NGINX_CONTAINER][NOTICE] Applying the Nginx template..."
108-
bash /etc/service/consul-template/run/consul-template.service
109105
echo "[INSIDE_NGINX_CONTAINER][NOTICE] Start the Nginx."
110106
bash /etc/service/nginx/run/nginx.service

.env.example

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ DOCKER_LAYER_CORRUPTION_RECOVERY=false
1010

1111

1212
NGINX_RESTART=false
13-
CONSUL_RESTART=false
1413

1514

1615
# The method of acquiring Docker images:
@@ -37,8 +36,6 @@ PROJECT_PORT=xxx
3736
# Samples : ADDITIONAL_PORTS=5005,5006
3837
ADDITIONAL_PORTS=8093
3938

40-
CONSUL_KEY_VALUE_STORE=http://consul:8500/v1/kv/deploy/xxx
41-
4239
# If you locate your project on ../ (upper folder)
4340
HOST_ROOT_LOCATION=../
4441
# If you locate your project's Dockerfile ../ (upper folder)
@@ -88,6 +85,4 @@ NGINX_LOGROTATE_FILE_SIZE=1M
8885

8986
SHARED_VOLUME_GROUP_ID=1351
9087
SHARED_VOLUME_GROUP_NAME=shared-volume-group
91-
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=
92-
93-
USE_MY_OWN_NGINX_ORIGIN=false
88+
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=

.env.example.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111

1212
NGINX_RESTART=false
13-
CONSUL_RESTART=false
1413

1514
# The method of acquiring Docker images:
1615
# build (Used in developer's local environment or during Jenkins builds when a new image needs to be built, so this module is typically used)
@@ -29,7 +28,6 @@
2928
# Example (8093,8094,11000...)
3029
ADDITIONAL_PORTS=5005
3130

32-
CONSUL_KEY_VALUE_STORE=http://consul:8500/v1/kv/deploy/spring-sample-h-auth
3331

3432
# If you locate your project on ../ (upper folder)
3533
HOST_ROOT_LOCATION=./samples/spring-sample-h-auth
@@ -79,6 +77,4 @@
7977

8078
SHARED_VOLUME_GROUP_ID=1351
8179
SHARED_VOLUME_GROUP_NAME=shared-volume-group
82-
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=
83-
84-
USE_MY_OWN_NGINX_ORIGIN=false
80+
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=

.env.example.java.commercial.ssl.sample

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ DOCKER_LAYER_CORRUPTION_RECOVERY=false
99

1010

1111
NGINX_RESTART=false
12-
CONSUL_RESTART=false
1312

1413

1514
# The method of acquiring Docker images:
@@ -29,7 +28,6 @@ PROJECT_PORT=8300
2928
# Example (8093,8094,11000...)
3029
ADDITIONAL_PORTS=
3130

32-
CONSUL_KEY_VALUE_STORE=http://consul:8500/v1/kv/deploy/spring-sample-h-auth
3331

3432
# 1) ''/var/web/project/spring-sample-h-auth' is here
3533
HOST_ROOT_LOCATION=/var/web/project/spring-sample-h-auth
@@ -81,6 +79,4 @@ NGINX_LOGROTATE_FILE_SIZE=1M
8179

8280
SHARED_VOLUME_GROUP_ID=1351
8381
SHARED_VOLUME_GROUP_NAME=shared-volume-group
84-
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=
85-
86-
USE_MY_OWN_NGINX_ORIGIN=false
82+
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=

.env.example.node

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ COMMERCIAL_SSL_NAME=yyy
99
DOCKER_LAYER_CORRUPTION_RECOVERY=false
1010

1111
NGINX_RESTART=false
12-
CONSUL_RESTART=false
1312

1413
# The method of acquiring Docker images:
1514
# build (Used in developer's local environment or during Jenkins builds when a new image needs to be built, so this module is typically used)
@@ -28,8 +27,6 @@ PROJECT_PORT=[13000,3000]
2827
# Example (8093,8094,11000...)
2928
ADDITIONAL_PORTS=
3029

31-
CONSUL_KEY_VALUE_STORE=http://consul:8500/v1/kv/deploy/node-express-boilerplate
32-
3330
# If you locate your project on ../ (upper folder)
3431
HOST_ROOT_LOCATION=./samples/node-express-boilerplate
3532
# If you locate your project's Dockerfile ../ (upper folder)
@@ -75,6 +72,4 @@ NGINX_LOGROTATE_FILE_SIZE=1M
7572

7673
SHARED_VOLUME_GROUP_ID=1351
7774
SHARED_VOLUME_GROUP_NAME=shared-volume-group
78-
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=
79-
80-
USE_MY_OWN_NGINX_ORIGIN=false
75+
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=

.env.example.php

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
DOCKER_LAYER_CORRUPTION_RECOVERY=false
1111

1212
NGINX_RESTART=false
13-
CONSUL_RESTART=false
1413

1514
# The method of acquiring Docker images:
1615
# build (Used in developer's local environment or during Jenkins builds when a new image needs to be built, so this module is typically used)
@@ -29,8 +28,6 @@
2928
# Example (8093,8094,11000...)
3029
ADDITIONAL_PORTS=
3130

32-
CONSUL_KEY_VALUE_STORE=http://consul:8500/v1/kv/deploy/laravel_crud_boilerplate
33-
3431
# If you locate your project on ../ (upper folder)
3532
HOST_ROOT_LOCATION=./samples/laravel-crud-boilerplate
3633
# If you locate your project's Dockerfile ../ (upper folder)
@@ -75,13 +72,11 @@
7572
# ex. /docs/api-app.html
7673
NGINX_RESTRICTED_LOCATION=xxx
7774

78-
REDIRECT_HTTPS_TO_HTTP=false
75+
REDIRECT_HTTPS_TO_HTTP=true
7976

8077
NGINX_LOGROTATE_FILE_NUMBER=7
8178
NGINX_LOGROTATE_FILE_SIZE=100K
8279

8380
SHARED_VOLUME_GROUP_ID=1351
8481
SHARED_VOLUME_GROUP_NAME=laravel-shared-volume-group
85-
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=1000
86-
87-
USE_MY_OWN_NGINX_ORIGIN=false
82+
UIDS_BELONGING_TO_SHARED_VOLUME_GROUP_ID=1000

0 commit comments

Comments
 (0)