Add docker-compose file for odu-app 49/7749/2
authorecaiyanlinux <martin.c.yan@est.tech>
Mon, 14 Feb 2022 13:52:27 +0000 (14:52 +0100)
committerecaiyanlinux <martin.c.yan@est.tech>
Mon, 14 Feb 2022 16:21:24 +0000 (17:21 +0100)
Signed-off-by: ecaiyanlinux <martin.c.yan@est.tech>
Change-Id: If623c29bd1c3136d8aab1c2c39fb5d38505c1189
Issue-ID: NONRTRIC-727

test/usecases/odusliceassurance/goversion/Dockerfile-simulator [new file with mode: 0644]
test/usecases/odusliceassurance/goversion/README.md
test/usecases/odusliceassurance/goversion/docker-compose.yaml [new file with mode: 0644]

diff --git a/test/usecases/odusliceassurance/goversion/Dockerfile-simulator b/test/usecases/odusliceassurance/goversion/Dockerfile-simulator
new file mode 100644 (file)
index 0000000..b6b7e8f
--- /dev/null
@@ -0,0 +1,41 @@
+#  Copyright (C) 2022 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+
+##
+## Build
+##
+FROM golang:1.17.1-bullseye AS build
+
+WORKDIR /app
+
+COPY . ./
+
+RUN go build -o /sdnr-mr-sim ./stub/
+
+##
+## Deploy
+##
+FROM gcr.io/distroless/base-debian10
+
+WORKDIR /
+
+## Copy from "build" stage
+COPY --from=build /sdnr-mr-sim .
+COPY --from=build /app/stub/test-data.csv .
+
+USER nonroot:nonroot
+
+ENTRYPOINT ["/sdnr-mr-sim"]
index d6eb4f8..f28ed4b 100644 (file)
@@ -6,7 +6,7 @@ The consumer takes a number of environment variables, described below, as config
 
 >- MR_HOST              **Required**. The host for Dmaap Message Router.                           Example: `http://mrproducer`
 >- MR_PORT              **Required**. The port for the Dmaap Message Router.                       Example: `8095`
->- SDNR_ADDRESS         Optional. The address for SDNR.                                            Defaults to `http://localhost:3904`.
+>- SDNR_ADDR            Optional. The address for SDNR.                                            Defaults to `http://localhost:3904`.
 >- SDNR_USER            Optional. The user for the SDNR.                                           Defaults to `admin`.
 >- SDNR_PASSWORD        Optional. The password for the SDNR user.                                  Defaults to `Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U`.
 >- LOG_LEVEL            Optional. The log level, which can be `Error`, `Warn`, `Info` or `Debug`.  Defaults to `Info`.
diff --git a/test/usecases/odusliceassurance/goversion/docker-compose.yaml b/test/usecases/odusliceassurance/goversion/docker-compose.yaml
new file mode 100644 (file)
index 0000000..495438d
--- /dev/null
@@ -0,0 +1,51 @@
+#  Copyright (C) 2022 Nordix Foundation. All rights reserved.
+#  ========================================================================
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#
+#       http://www.apache.org/licenses/LICENSE-2.0
+#
+#  Unless required by applicable law or agreed to in writing, software
+#  distributed under the License is distributed on an "AS IS" BASIS,
+#  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#  See the License for the specific language governing permissions and
+#  limitations under the License.
+#  ============LICENSE_END=================================================
+#
+version: '3.5'
+
+networks:
+  default:
+    driver: bridge
+    name: nonrtric-docker-net
+
+services:
+  sdnr-mr-sim:
+    build:
+      context: .
+      dockerfile: Dockerfile-simulator
+    container_name: sdnr-mr-sim
+    networks:
+      default:
+        aliases:
+          - sdnr-mr-sim
+    ports:
+      - 3904:3904
+      - 3905:3905
+
+  odu-app:
+    build:
+      context: .
+      dockerfile: Dockerfile
+    container_name: odu-app
+    networks:
+      default:
+        aliases:
+          - odu-app
+    ports:
+      - 8086:8086
+    environment:
+      - MR_HOST=http://sdnr-mr-sim
+      - MR_PORT=3905
+      - SDNR_ADDR=http://sdnr-mr-sim:3904
\ No newline at end of file