2021-05-14 13:23:04 +00:00
|
|
|
# build stage
|
2021-09-07 04:24:21 +00:00
|
|
|
FROM golang:1.17.0-alpine AS build-env
|
2021-05-14 13:23:04 +00:00
|
|
|
RUN apk --no-cache add build-base git gcc
|
2021-09-07 04:24:21 +00:00
|
|
|
|
|
|
|
RUN mkdir -p /build
|
|
|
|
COPY ./steward /build/
|
|
|
|
|
|
|
|
WORKDIR /build/cmd/steward/
|
|
|
|
RUN go version
|
2021-05-14 13:23:04 +00:00
|
|
|
RUN go build -o steward
|
|
|
|
|
|
|
|
# final stage
|
|
|
|
FROM alpine
|
2021-09-07 04:24:21 +00:00
|
|
|
|
|
|
|
RUN apk update && apk add curl && apk add nmap
|
|
|
|
|
2021-05-14 13:23:04 +00:00
|
|
|
WORKDIR /app
|
2021-09-07 04:24:21 +00:00
|
|
|
COPY --from=build-env /build/cmd/steward/steward /app/
|
2021-05-14 13:23:04 +00:00
|
|
|
|
|
|
|
ENV CONFIG_FOLDER "./etc"
|
|
|
|
ENV SOCKET_FOLDER "./tmp"
|
2021-09-07 04:24:21 +00:00
|
|
|
ENV TCP_LISTENER ""
|
2021-09-10 03:44:26 +00:00
|
|
|
ENV HTTP_LISTENER "localhost:8091"
|
2021-05-14 13:23:04 +00:00
|
|
|
ENV DATABASE_FOLDER "./var/lib"
|
|
|
|
ENV NODE_NAME ""
|
|
|
|
ENV BROKER_ADDRESS "127.0.0.1:4222"
|
2021-09-07 04:24:21 +00:00
|
|
|
ENV NATS_CONNECT_RETRY_INTERVAL "10"
|
2021-05-14 13:23:04 +00:00
|
|
|
ENV PROFILING_PORT ""
|
2021-09-07 04:24:21 +00:00
|
|
|
ENV PROM_HOST_AND_PORT "127.0.0.1:2111"
|
2021-05-14 13:23:04 +00:00
|
|
|
ENV DEFAULT_MESSAGE_TIMEOUT 10
|
|
|
|
ENV DEFAULT_MESSAGE_RETRIES 3
|
2021-09-09 11:16:10 +00:00
|
|
|
ENV ERROR_MESSAGE_RETRIES 3
|
|
|
|
ENV ERROR_MESSAGE_TIMEOUT 10
|
2021-05-14 13:23:04 +00:00
|
|
|
ENV SUBSCRIBERS_DATA_FOLDER "./var"
|
2021-09-07 04:24:21 +00:00
|
|
|
ENV EXPOSE_DATA_FOLDER "127.0.0.1:8090"
|
2021-05-14 13:23:04 +00:00
|
|
|
ENV CENTRAL_NODE_NAME ""
|
|
|
|
ENV ROOT_CA_PATH ""
|
|
|
|
ENV NKEY_SEED_FILE ""
|
|
|
|
|
|
|
|
ENV START_PUB_REQ_HELLO 60
|
|
|
|
|
|
|
|
ENV START_SUB_REQ_ERROR_LOG ""
|
|
|
|
ENV START_SUB_REQ_HELLO ""
|
|
|
|
ENV START_SUB_REQ_TO_FILE_APPEND ""
|
|
|
|
ENV START_SUB_REQ_TO_FILE ""
|
|
|
|
ENV START_SUB_REQ_PING ""
|
|
|
|
ENV START_SUB_REQ_PONG ""
|
|
|
|
ENV START_SUB_REQ_CLI_COMMAND ""
|
|
|
|
ENV START_SUB_REQ_TO_CONSOLE ""
|
|
|
|
ENV START_SUB_REQ_HTTP_GET ""
|
|
|
|
ENV START_SUB_REQ_TAIL_FILE ""
|
2021-09-17 08:17:10 +00:00
|
|
|
ENV START_SUB_REQ_CLI_COMMAND_CONT ""
|
2021-05-14 13:23:04 +00:00
|
|
|
|
2021-09-07 04:24:21 +00:00
|
|
|
CMD ["ash","-c","env CONFIGFOLDER=./etc/ /app/steward\
|
2021-05-14 13:23:04 +00:00
|
|
|
-socketFolder=$SOCKET_FOLDER\
|
2021-09-07 04:24:21 +00:00
|
|
|
-tcpListener=$TCP_LISTENER\
|
2021-09-10 03:44:26 +00:00
|
|
|
-httpListener=$HTTP_LISTENER\
|
2021-05-14 13:23:04 +00:00
|
|
|
-databaseFolder=$DATABASE_FOLDER\
|
|
|
|
-nodeName=$NODE_NAME\
|
|
|
|
-brokerAddress=$BROKER_ADDRESS\
|
2021-09-07 04:24:21 +00:00
|
|
|
-natsConnectRetryInterval=$NATS_CONNECT_RETRY_INTERVAL\
|
2021-05-14 13:23:04 +00:00
|
|
|
-profilingPort=$PROFILING_PORT\
|
|
|
|
-promHostAndPort=$PROM_HOST_AND_PORT\
|
|
|
|
-defaultMessageTimeout=$DEFAULT_MESSAGE_TIMEOUT\
|
|
|
|
-defaultMessageRetries=$DEFAULT_MESSAGE_RETRIES\
|
2021-09-09 11:16:10 +00:00
|
|
|
-errorMessageRetries=$ERROR_MESSAGE_RETRIES\
|
|
|
|
-errorMessageTimeout=$ERROR_MESSAGE_TIMEOUT\
|
2021-09-07 04:24:21 +00:00
|
|
|
-subscribersDataFolder=$SUBSCRIBERS_DATA_FOLDER\
|
|
|
|
-exposeDataFolder=$EXPOSE_DATA_FOLDER\
|
2021-05-14 13:23:04 +00:00
|
|
|
-centralNodeName=$CENTRAL_NODE_NAME\
|
|
|
|
-rootCAPath=$ROOT_CA_PATH\
|
|
|
|
-nkeySeedFile=$NKEY_SEED_FILE\
|
|
|
|
-startPubREQHello=$START_PUB_REQ_HELLO\
|
|
|
|
-startSubREQErrorLog=$START_SUB_REQ_ERROR_LOG\
|
|
|
|
-startSubREQHello=$START_SUB_REQ_HELLO\
|
|
|
|
-startSubREQToFileAppend=$START_SUB_REQ_TO_FILE_APPEND\
|
|
|
|
-startSubREQToFile=$START_SUB_REQ_TO_FILE\
|
|
|
|
-startSubREQPing=$START_SUB_REQ_PING\
|
|
|
|
-startSubREQPong=$START_SUB_REQ_PONG\
|
|
|
|
-startSubREQCliCommand=$START_SUB_REQ_CLI_COMMAND\
|
|
|
|
-startSubREQToConsole=$START_SUB_REQ_TO_CONSOLE\
|
|
|
|
-startSubREQHttpGet=$START_SUB_REQ_HTTP_GET\
|
|
|
|
-startSubREQTailFile=$START_SUB_REQ_TAIL_FILE\
|
2021-09-17 08:17:10 +00:00
|
|
|
-startSubREQCliCommandCont=$START_SUB_REQ_CLI_COMMAND_CONT\
|
2021-09-07 04:24:21 +00:00
|
|
|
"]
|