Skip to content

Commit 02841bc

Browse files
authored
chore: include ADVERTISED_HTTP_PORT (#2048)
* chore: include ADVERTISED_HTTP_PORT * maven archetypes * move USER_SERVICE_HOST to .env file * remove unnecessary vars from spring test * fix typo * use explicit ports in docker-compose-integration
1 parent e021e2d commit 02841bc

File tree

128 files changed

+1020
-145
lines changed

Some content is hidden

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

128 files changed

+1020
-145
lines changed

maven-java/kalix-maven-archetype-event-sourced-entity/src/main/resources/META-INF/maven/archetype-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<include>**/*</include>
1919
</includes>
2020
</fileSet>
21+
<fileSet filtered="true">
22+
<directory></directory>
23+
<includes>
24+
<include>.env</include>
25+
</includes>
26+
</fileSet>
2127
<fileSet filtered="true" encoding="UTF-8">
2228
<directory/>
2329
<includes>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# this is the port where the kalix runtime container will be exposed
2+
# when running multiple services on your local machine, make sure that the ports unique
3+
ADVERTISED_HTTP_PORT=9000
4+
5+
# this is the port where the user services (your application) will open
6+
# when running multiple services on your local machine, make sure that the ports unique
7+
USER_SERVICE_PORT=8080
8+
9+
# this variable defines the host where the kalix runtime (running in docker)
10+
# will reach the user service in local development
11+
USER_SERVICE_HOST=host.docker.internal

maven-java/kalix-maven-archetype-event-sourced-entity/src/main/resources/archetype-resources/docker-compose.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ services:
88
image: gcr.io/kalix-public/kalix-runtime:1.1.33
99
container_name: ]]#${artifactId}#[[
1010
ports:
11-
- "9000:9000"
11+
- "${ADVERTISED_HTTP_PORT}:9000"
1212
extra_hosts:
1313
- "host.docker.internal:host-gateway"
1414
environment:
1515
JAVA_TOOL_OPTIONS: >
1616
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)
1717

18-
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
19-
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
18+
# those variables are defined in the .env file
19+
# when running multiple services on your local machine, make sure that
20+
# the ports are unique by editing the corresponding .env files
21+
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
22+
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
23+
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
2024
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
2125
ACL_ENABLED: "false"
2226
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)

maven-java/kalix-maven-archetype-value-entity/src/main/resources/META-INF/maven/archetype-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<include>**/*</include>
1919
</includes>
2020
</fileSet>
21+
<fileSet filtered="true">
22+
<directory></directory>
23+
<includes>
24+
<include>.env</include>
25+
</includes>
26+
</fileSet>
2127
<fileSet filtered="true" encoding="UTF-8">
2228
<directory/>
2329
<includes>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# this is the port where the kalix runtime container will be exposed
2+
# when running multiple services on your local machine, make sure that the ports unique
3+
ADVERTISED_HTTP_PORT=9000
4+
5+
# this is the port where the user services (your application) will open
6+
# when running multiple services on your local machine, make sure that the ports unique
7+
USER_SERVICE_PORT=8080
8+
9+
# this variable defines the host where the kalix runtime (running in docker)
10+
# will reach the user service in local development
11+
USER_SERVICE_HOST=host.docker.internal

maven-java/kalix-maven-archetype-value-entity/src/main/resources/archetype-resources/docker-compose.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ services:
88
image: gcr.io/kalix-public/kalix-runtime:1.1.33
99
container_name: ]]#${artifactId}#[[
1010
ports:
11-
- "9000:9000"
11+
- "${ADVERTISED_HTTP_PORT}:9000"
1212
extra_hosts:
1313
- "host.docker.internal:host-gateway"
1414
environment:
1515
JAVA_TOOL_OPTIONS: >
1616
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)
1717

18-
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
19-
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
18+
# those variables are defined in the .env file
19+
# when running multiple services on your local machine, make sure that
20+
# the ports are unique by editing the corresponding .env files
21+
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
22+
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
23+
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
2024
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
2125
ACL_ENABLED: "false"
2226
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)

maven-java/kalix-spring-boot-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<include>**/*</include>
1919
</includes>
2020
</fileSet>
21+
<fileSet filtered="true">
22+
<directory></directory>
23+
<includes>
24+
<include>.env</include>
25+
</includes>
26+
</fileSet>
2127
<fileSet filtered="true" encoding="UTF-8">
2228
<directory/>
2329
<includes>
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# this is the port where the kalix runtime container will be exposed
2+
# when running multiple services on your local machine, make sure that the ports unique
3+
ADVERTISED_HTTP_PORT=9000
4+
5+
# this is the port where the user services (your application) will open
6+
# when running multiple services on your local machine, make sure that the ports unique
7+
USER_SERVICE_PORT=8080
8+
9+
# this variable defines the host where the kalix runtime (running in docker)
10+
# will reach the user service in local development
11+
USER_SERVICE_HOST=host.docker.internal

maven-java/kalix-spring-boot-archetype/src/main/resources/archetype-resources/docker-compose.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,19 @@ services:
88
image: gcr.io/kalix-public/kalix-runtime:1.1.33
99
container_name: ]]#${artifactId}#[[
1010
ports:
11-
- "9000:9000"
11+
- "${ADVERTISED_HTTP_PORT}:9000"
1212
extra_hosts:
1313
- "host.docker.internal:host-gateway"
1414
environment:
1515
JAVA_TOOL_OPTIONS: >
1616
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)
1717

18-
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
19-
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
18+
# those variables are defined in the .env file
19+
# when running multiple services on your local machine, make sure that
20+
# the ports are unique by editing the corresponding .env files
21+
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
22+
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
23+
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
2024
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
2125
ACL_ENABLED: "false"
2226
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)

maven-java/kalix-spring-boot-kotlin-archetype/src/main/resources/META-INF/maven/archetype-metadata.xml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@
1818
<include>**/*</include>
1919
</includes>
2020
</fileSet>
21+
<fileSet filtered="true">
22+
<directory></directory>
23+
<includes>
24+
<include>.env</include>
25+
</includes>
26+
</fileSet>
2127
<fileSet filtered="true" encoding="UTF-8">
2228
<directory/>
2329
<includes>

0 commit comments

Comments
 (0)