Skip to content

Commit c01abfa

Browse files
author
Bernhard B
authored
Merge pull request #43 from funkybunch/ARM-dependency-fix
JRE Dependency Fix + Port Configuration
2 parents 12a16c3 + 57665c4 commit c01abfa

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ COPY src/go.sum /tmp/signal-cli-rest-api-src/
3939
RUN cd /tmp/signal-cli-rest-api-src && swag init && go build
4040

4141
# Start a fresh container for release container
42-
FROM adoptopenjdk:11-jre-hotspot
42+
FROM adoptopenjdk:11-jdk-hotspot-bionic
4343

4444
COPY --from=buildcontainer /tmp/signal-cli-rest-api-src/signal-cli-rest-api /usr/bin/signal-cli-rest-api
4545
COPY --from=buildcontainer /tmp/signal-cli /opt/signal-cli

docker-compose.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ version: "3"
22
services:
33
signal-cli-rest-api:
44
build: "."
5+
environment:
6+
- PORT=8080
57
ports:
68
- "8080:8080" #map docker port 8080 to host port 8080.
79
volumes:

src/main.go

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package main
22

33
import (
44
"flag"
5+
"os"
56

67
"github.com/gin-gonic/gin"
78
log "github.com/sirupsen/logrus"
@@ -85,8 +86,17 @@ func main() {
8586
}
8687
}
8788

88-
swaggerUrl := ginSwagger.URL("http://127.0.0.1:8080/swagger/doc.json")
89+
swaggerPort := getEnv("PORT", "8080")
90+
91+
swaggerUrl := ginSwagger.URL("http://127.0.0.1:" + string(swaggerPort) + "/swagger/doc.json")
8992
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerUrl))
9093

9194
router.Run()
9295
}
96+
97+
func getEnv(key string, defaultVal string) string {
98+
if value, exists := os.LookupEnv(key); exists {
99+
return value
100+
}
101+
return defaultVal
102+
}

0 commit comments

Comments
 (0)