Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ private LocalstackDockerConfiguration processDockerPropertiesAnnotation(Localsta
.ignoreDockerRunErrors(properties.ignoreDockerRunErrors())
.randomizePorts(properties.randomizePorts())
.imageTag(StringUtils.isEmpty(properties.imageTag()) ? null : properties.imageTag())
.portEdge(properties.portEdge())
.portElasticSearch(properties.portElasticSearch())
.portEdge(getEnvOrDefault("LOCALSTACK_EDGE_PORT", properties.portEdge()))
.portElasticSearch(getEnvOrDefault("LOCALSTACK_ELASTICSEARCH_PORT", properties.portElasticSearch()))
.useSingleDockerContainer(properties.useSingleDockerContainer())
.build();
}

private String getEnvOrDefault(final String environmentVariable, final String defaultValue) {
return System.getenv().getOrDefault(environmentVariable, defaultValue);
}

private Map<Integer, Integer> getCustomPortMappings(final LocalstackDockerProperties properties) {
final Map<Integer, Integer> portMappings = new HashMap<>();
for (String service : properties.services()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,14 @@
String imageTag() default "";

/**
* Port number for the edge service, the main entry point for all API invocations
* Port number for the edge service, the main entry point for all API invocations. Alternatively, use the
* LOCALSTACK_EDGE_PORT environment variable.
*/
String portEdge() default "4566";

/**
* Port number for the elasticsearch service
* Port number for the elasticsearch service. Alternatively, use the LOCALSTACK_ELASTICSEARCH_PORT environment
* variable.
*/
String portElasticSearch() default "4571";

Expand Down