diff --git a/Dockerfile b/Dockerfile index c649ae1..435e944 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,7 +3,7 @@ ARG GO_VERSION=1.21 FROM alpine:${ALPINE_VERSION} AS certificator RUN apk --update add --no-cache ca-certificates openssl git tzdata && \ -update-ca-certificates + update-ca-certificates FROM golang:${GO_VERSION}-alpine AS builder WORKDIR /app @@ -21,25 +21,9 @@ ENV UNCONDITIONAL_API_BUILD_RELEASE_VERSION=${UNCONDITIONAL_API_BUILD_RELEASE_VE RUN go build --ldflags "-X 'main.releaseVersion=${UNCONDITIONAL_API_BUILD_RELEASE_VERSION}' -X 'main.gitCommit=${UNCONDITIONAL_API_BUILD_COMMIT_VERSION}'" --tags=release -o main . -FROM builder as data -WORKDIR /data -COPY --from=builder /app/main /app/main - -ARG UNCONDITIONAL_API_SOURCE_REPO -ARG UNCONDITIONAL_API_LOG_ENV -ENV UNCONDITIONAL_API_SOURCE_REPO=${UNCONDITIONAL_API_SOURCE_REPO} -ENV UNCONDITIONAL_API_LOG_ENV=${UNCONDITIONAL_API_LOG_ENV} - -RUN --mount=type=secret,id=UNCONDITIONAL_API_SOURCE_CLIENT_KEY \ - UNCONDITIONAL_API_SOURCE_CLIENT_KEY="$(cat /run/secrets/UNCONDITIONAL_API_SOURCE_CLIENT_KEY)" \ - /app/main source download --path /data/source.json - -RUN /app/main index create --source /data/source.json --name /data/index - FROM scratch as release COPY --from=certificator /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ COPY --from=builder /app/main /app/main -COPY --from=data /data /data ARG UNCONDITIONAL_API_ADDRESS ARG UNCONDITIONAL_API_ALLOWED_ORIGINS @@ -55,4 +39,4 @@ ENV UNCONDITIONAL_API_SOURCE_REPO=${UNCONDITIONAL_API_SOURCE_REPO} ENV UNCONDITIONAL_API_SOURCE_CLIENT_KEY=${UNCONDITIONAL_API_SOURCE_CLIENT_KEY} ENV UNCONDITIONAL_API_LOG_ENV=${UNCONDITIONAL_API_LOG_ENV} -ENTRYPOINT ["./app/main","serve", "--address", "0.0.0.0", "--port","8080", "--index","/data/index"] +ENTRYPOINT ["./app/main","serve", "--address", "0.0.0.0", "--port","8080"] diff --git a/cmd/serve.go b/cmd/serve.go index c4cc9ac..c206206 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -95,7 +95,6 @@ func NewServeCommand(version version.Build) *cobra.Command { cmd.Flags().StringP("address", "a", "localhost", "Server address") cmd.Flags().IntP("port", "p", 8080, "Server port") - cmd.Flags().StringP("index", "s", "", "Index path") cmd.Flags().String("allowed-origins", "", "Allowed Origins") cmd.Flags().String("source-repo", "", "Source Repository") cmd.Flags().String("source-client-key", "", "Source Client Key")