Fix Dockerfile to add config file and certs 79/11279/1
authorychacon <yennifer.chacon@est.tech>
Wed, 7 Jun 2023 12:42:33 +0000 (14:42 +0200)
committerychacon <yennifer.chacon@est.tech>
Wed, 7 Jun 2023 12:42:33 +0000 (14:42 +0200)
Issue-ID: NONRTRIC-833
Signed-off-by: ychacon <yennifer.chacon@est.tech>
Change-Id: I83011e20c0d49850af4f6358c24df2bef0609c10

capifcore/Dockerfile
capifcore/configs/keycloak.yaml
capifcore/internal/restclient/HTTPClient.go

index ed97579..f564d3f 100644 (file)
@@ -30,9 +30,16 @@ RUN go build -o /capifcore
 ##
 ## Deploy
 ##
-FROM gcr.io/distroless/base-debian11
+FROM ubuntu
 WORKDIR /
 ## Copy from "build" stage
 COPY --from=build /capifcore .
-USER nonroot:nonroot
+
+RUN mkdir /configs
+RUN mkdir /certs
+
+COPY configs/keycloak.yaml /configs/keycloak.yaml
+COPY certs/cert.pem /certs/cert.pem
+COPY certs/key.pem /certs/key.pem
+
 ENTRYPOINT ["/capifcore"]
index 86b3905..3f05b42 100644 (file)
@@ -17,7 +17,7 @@
 
 # Keycloak configurations
 authorizationServer:
-  host: "localhost"
+  host: "keycloak"
   port: "8080"
   admin:
     user: "admin"
index e9d3469..0dc2f24 100644 (file)
@@ -71,7 +71,6 @@ func do(method string, url string, body []byte, header map[string]string, client
 
                if response, respErr := client.Do(req); respErr == nil {
                        if isResponseSuccess(response.StatusCode) {
-                               fmt.Printf("HTTP client:: response statuscode:: %v body:: %v\n", response.StatusCode, response.Body)
                                defer response.Body.Close()
 
                                // Read the response body