Skip to content

Commit ed02a56

Browse files
committed
feat: public port as environment variable
1 parent 25ddf8e commit ed02a56

File tree

9 files changed

+19
-11
lines changed

9 files changed

+19
-11
lines changed

admin/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const OUTPUT_DIR = '../../build';
1414
const ASSETS_DIR = 'assets';
1515
const ICON_DIR = ASSETS_DIR + '/icon.png';
1616
const DEV_PORT = 8080;
17-
const PUBLIC_PORT = 9999;
17+
const PUBLIC_PORT = process.env.COMMON_PUBLIC_PORT;
1818

1919
module.exports = function(env, argv) {
2020
const isProd = !!env.production;

client/webpack.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const OUTPUT_DIR = '../../build';
1818
const ASSETS_DIR = 'assets';
1919
const PWA_ICON_DIR = ASSETS_DIR + '/icon.png';
2020
const DEV_PORT = 8080;
21-
const PUBLIC_PORT = 9999;
21+
const PUBLIC_PORT = process.env.COMMON_PUBLIC_PORT;
2222

2323
module.exports = function(env, argv) {
2424
const isProd = !!env.production;

docker-compose-remote.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ services:
6161
COMMON_COMPANY: companyname
6262
COMMON_PROJECT: server-template
6363
COMMON_DOMAIN: localhost
64-
COMMON_URL: http://localhost:9999
64+
COMMON_URL: http://localhost:_PORT_
6565
COMMON_DEBUG: 'false'
6666
COMMON_LOG_FORMAT: text
6767
COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal

docker-compose.yaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ services:
2828
environment:
2929
COMMON_COMPANY: companyname
3030
COMMON_PROJECT: server-template
31+
COMMON_PUBLIC_PORT: 9999
3132

3233
server-template-client:
3334
container_name: server-template-client
@@ -50,6 +51,7 @@ services:
5051
environment:
5152
COMMON_COMPANY: companyname
5253
COMMON_PROJECT: server-template
54+
COMMON_PUBLIC_PORT: 9999
5355
# NOTE: Database connection is for tests only
5456
DATABASE_HOST: server-template-database
5557
DATABASE_NAME: ${db_database_name}
@@ -72,6 +74,7 @@ services:
7274
environment:
7375
COMMON_COMPANY: companyname
7476
COMMON_PROJECT: server-template
77+
COMMON_PUBLIC_PORT: 9999
7578
COMMON_DOMAIN: localhost
7679
COMMON_URL: http://localhost:9999
7780
COMMON_DEBUG: 'false'
@@ -105,6 +108,7 @@ services:
105108
environment:
106109
COMMON_COMPANY: companyname
107110
COMMON_PROJECT: server-template
111+
COMMON_PUBLIC_PORT: 9999
108112
COMMON_DEBUG: 'false'
109113
COMMON_LOG_FORMAT: text
110114
COMMON_LOG_LEVEL: info # trace, debug, info, warn, error, fatal
@@ -142,6 +146,8 @@ services:
142146
- "/service/site/node_modules"
143147
# FOR GATSBY ONLY:
144148
# - "/service/site/node_modules"
149+
environment:
150+
COMMON_PUBLIC_PORT: 9999
145151

146152
server-template-cache:
147153
container_name: server-template-cache

scripts/helm.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
global:
22
domain: ${taito_domain}
33
url: https://${taito_domain}
4+
publicPort: 443
45
logFormat: stackdriver
56
logLevel: info # trace, debug, info, warn, error, fatal
67
registry: ${taito_container_registry}

scripts/helm/requirements.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
dependencies:
22
- name: full-stack
3-
version: 0.4.0
3+
version: 0.4.1
44
repository: https://taitounited.github.io/taito-charts/

scripts/helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,4 @@ global:
2323
logLevel: info # trace, debug, info, warn, error, fatal
2424
registry: ${taito_container_registry}
2525
imagePullPolicy: ''
26+
debug: false

scripts/taito-template/init.sh

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,10 @@ ingress_port=$(shuf -i 8000-9999 -n 1)
192192
db_port=$(shuf -i 6000-7999 -n 1)
193193
www_port=$(shuf -i 5000-5999 -n 1)
194194
sed -i "s/7463/${www_port}/g" taito-config.sh docker-compose.yaml \
195-
docker-compose-remote.yaml TAITOLESS.md &> /dev/null
195+
TAITOLESS.md www/README.md &> /dev/null
196196
sed -i "s/6000/${db_port}/g" taito-config.sh docker-compose.yaml \
197-
docker-compose-remote.yaml TAITOLESS.md &> /dev/null
197+
TAITOLESS.md &> /dev/null
198198
sed -i "s/9999/${ingress_port}/g" taito-config.sh docker-compose.yaml \
199-
docker-compose-remote.yaml ./admin/package.json ./client/package.json \
200199
TAITOLESS.md &> /dev/null || :
201200

202201
./scripts/taito-template/common.sh

www/develop.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
#!/bin/bash
2+
: "${COMMON_PUBLIC_PORT:?}"
23

34
set -x
45

@@ -15,12 +16,12 @@ elif [ -f ./site/Gemfile ]; then
1516
cd /service/site && \
1617
bundle update && \
1718
bundle exec jekyll serve --host 0.0.0.0 --port 8080 \
18-
--baseurl http://localhost:9999 \
19-
--livereload --livereload-port 9999
19+
--baseurl "http://localhost:$COMMON_PUBLIC_PORT" \
20+
--livereload --livereload-port "$COMMON_PUBLIC_PORT"
2021
else
2122
# Hugo development
2223
cd /service/site && \
2324
hugo server -D --bind=0.0.0.0 --port 8080 \
24-
--baseURL http://localhost:9999 --appendPort=false \
25-
--liveReloadPort 9999
25+
--baseURL "http://localhost:$COMMON_PUBLIC_PORT" --appendPort=false \
26+
--liveReloadPort "$COMMON_PUBLIC_PORT"
2627
fi

0 commit comments

Comments
 (0)