Skip to content

Commit

Permalink
chore: include ADVERTISED_HTTP_PORT (#2048)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
octonato authored Mar 6, 2024
1 parent e021e2d commit 02841bc
Show file tree
Hide file tree
Showing 128 changed files with 1,020 additions and 145 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>.env</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory/>
<includes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: ]]#${artifactId}#[[
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
ACL_ENABLED: "false"
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>.env</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory/>
<includes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: ]]#${artifactId}#[[
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
ACL_ENABLED: "false"
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>.env</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory/>
<includes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: ]]#${artifactId}#[[
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
ACL_ENABLED: "false"
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@
<include>**/*</include>
</includes>
</fileSet>
<fileSet filtered="true">
<directory></directory>
<includes>
<include>.env</include>
</includes>
</fileSet>
<fileSet filtered="true" encoding="UTF-8">
<directory/>
<includes>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,19 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: ]]#${artifactId}#[[
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_PORT: ${USER_SERVICE_PORT:-8080}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
# Comment to enable ACL check in dev-mode (see https://docs.kalix.io/services/using-acls.html#_local_development_with_acls)
ACL_ENABLED: "false"
# Uncomment to enable advanced view features locally (note: disabled in deployed services by default)
Expand Down
10 changes: 10 additions & 0 deletions samples/java-protobuf-customer-registry-kafka-quickstart/.env
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ services:
# volumes:
# - ./target/kalix:/var/kalix
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
PERSISTENCE_ENABLED: "false" #when true uncomment volumes above
JAVA_TOOL_OPTIONS: >
-Dkalix.proxy.eventing.support=kafka
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
# configuring kafka broker used for eventing
BROKER_SERVERS: kafka:29092
Expand Down
10 changes: 10 additions & 0 deletions samples/java-protobuf-customer-registry-quickstart/.env
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: java-protobuf-customer-registry-quickstart
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
#PUBSUB_EMULATOR_HOST: gcloud-pubsub-emulator
#gcloud-pubsub-emulator:
Expand Down
10 changes: 10 additions & 0 deletions samples/java-protobuf-customer-registry-views-quickstart/.env
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,18 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: java-protobuf-customer-registry-views-quickstart
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
#PUBSUB_EMULATOR_HOST: gcloud-pubsub-emulator
#gcloud-pubsub-emulator:
Expand Down
10 changes: 10 additions & 0 deletions samples/java-protobuf-doc-snippets/.env
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
10 changes: 10 additions & 0 deletions samples/java-protobuf-eventsourced-counter/.env
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9000

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8080

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
8 changes: 6 additions & 2 deletions samples/java-protobuf-eventsourced-counter/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,17 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: java-protobuf-eventsourced-counter
ports:
- "9000:9000"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
JAVA_TOOL_OPTIONS: >
-Dkalix.proxy.eventing.support=google-pubsub-emulator
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
PUBSUB_EMULATOR_HOST: gcloud-pubsub-emulator
depends_on:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
USER_SERVICE_PORT=8080
# this is the port where the kalix runtime container will be exposed
# when running multiple services on your local machine, make sure that the ports unique
ADVERTISED_HTTP_PORT=9001

# this is the port where the user services (your application) will open
# when running multiple services on your local machine, make sure that the ports unique
USER_SERVICE_PORT=8081

# this variable defines the host where the kalix runtime (running in docker)
# will reach the user service in local development
USER_SERVICE_HOST=host.docker.internal
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,14 @@ services:
depends_on:
- kalix-runtime-customer-registry
ports:
- "9001:9001"
- "9001:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
HTTP_PORT: "9001"
JAVA_TOOL_OPTIONS: >
-Dkalix.dev-mode.service-port-mappings.customer-registry=host.docker.internal:9000
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
ADVERTISED_HTTP_PORT: 9001
USER_SERVICE_HOST: host.docker.internal
USER_SERVICE_PORT: "8081"

kalix-runtime-customer-registry:
Expand All @@ -31,7 +31,7 @@ services:
JAVA_TOOL_OPTIONS: >
# jvm -D properties can be added under this environment map (note: remove this comment when adding properties)

USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_HOST: host.docker.internal
USER_SERVICE_PORT: "8080"

customer-registry:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ services:
image: gcr.io/kalix-public/kalix-runtime:1.1.33
container_name: java-protobuf-eventsourced-customer-registry-subscriber
ports:
- "9001:9001"
- "${ADVERTISED_HTTP_PORT}:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
HTTP_PORT: "9001"
JAVA_TOOL_OPTIONS: >
-Dkalix.dev-mode.service-port-mappings.customer-registry=host.docker.internal:9000
USER_SERVICE_HOST: ${USER_SERVICE_HOST:-host.docker.internal}
USER_SERVICE_PORT: "8081"
# those variables are defined in the .env file
# when running multiple services on your local machine, make sure that
# the ports are unique by editing the corresponding .env files
ADVERTISED_HTTP_PORT: ${ADVERTISED_HTTP_PORT}
USER_SERVICE_HOST: ${USER_SERVICE_HOST}
USER_SERVICE_PORT: ${USER_SERVICE_PORT}
#end::customer-registry-subscriber[]
Loading

0 comments on commit 02841bc

Please sign in to comment.