File tree Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Expand file tree Collapse file tree 3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ COPY src/go.sum /tmp/signal-cli-rest-api-src/
3939RUN 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
4444COPY --from=buildcontainer /tmp/signal-cli-rest-api-src/signal-cli-rest-api /usr/bin/signal-cli-rest-api
4545COPY --from=buildcontainer /tmp/signal-cli /opt/signal-cli
Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ version: "3"
22services :
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 :
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package main
22
33import (
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+ }
You can’t perform that action at this time.
0 commit comments