Skip to content

Commit

Permalink
chore: update env files and dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibarbato committed Feb 12, 2024
1 parent 0037071 commit af6026b
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .env.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ export UNCONDITIONAL_API_SOURCE_CLIENT_KEY="secret"
export UNCONDITIONAL_API_LOG_ENV="dev"
export UNCONDITIONAL_API_BUILD_COMMIT_VERSION=
export UNCONDITIONAL_API_BUILD_RELEASE_VERSION=
export UNCONDITIONAL_API_FEED_REPO_INDEX="feeds"
export UNCONDITIONAL_API_FEED_REPO_HOST="http://localhost:8108"
export UNCONDITIONAL_API_FEED_REPO_KEY="xyz"
3 changes: 3 additions & 0 deletions .envrc.dist
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ export UNCONDITIONAL_API_SOURCE_CLIENT_KEY="secret"
export UNCONDITIONAL_API_LOG_ENV="dev"
export UNCONDITIONAL_API_BUILD_COMMIT_VERSION=
export UNCONDITIONAL_API_BUILD_RELEASE_VERSION=
export UNCONDITIONAL_API_FEED_REPO_INDEX="feeds"
export UNCONDITIONAL_API_FEED_REPO_HOST="http://localhost:8108"
export UNCONDITIONAL_API_FEED_REPO_KEY="xyz"
18 changes: 13 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,14 @@ 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}
ARG UNCONDITIONAL_API_FEED_REPO_INDEX
ARG UNCONDITIONAL_API_FEED_REPO_HOST
ARG UNCONDITIONAL_API_FEED_REPO_KEY
ENV UNCONDITIONAL_API_FEED_REPO_INDEX=${UNCONDITIONAL_API_FEED_REPO_INDEX}
ENV UNCONDITIONAL_API_FEED_REPO_HOST=${UNCONDITIONAL_API_FEED_REPO_HOST}
ENV UNCONDITIONAL_API_FEED_REPO_KEY=${UNCONDITIONAL_API_FEED_REPO_KEY}

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
RUN /app/main index create --name ${UNCONDITIONAL_API_FEED_REPO_INDEX}

FROM scratch as release
COPY --from=certificator /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
Expand All @@ -47,12 +49,18 @@ ARG UNCONDITIONAL_API_PORT
ARG UNCONDITIONAL_API_SOURCE_REPO
ARG UNCONDITIONAL_API_SOURCE_CLIENT_KEY
ARG UNCONDITIONAL_API_LOG_ENV
ARG UNCONDITIONAL_API_FEED_REPO_INDEX
ARG UNCONDITIONAL_API_FEED_REPO_HOST
ARG UNCONDITIONAL_API_FEED_REPO_KEY

ENV UNCONDITIONAL_API_ADDRESS=${UNCONDITIONAL_API_ADDRESS}
ENV UNCONDITIONAL_API_ALLOWED_ORIGINS=${UNCONDITIONAL_API_ALLOWED_ORIGINS}
ENV UNCONDITIONAL_API_PORT=${UNCONDITIONAL_API_PORT}
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}
ENV UNCONDITIONAL_API_FEED_REPO_INDEX=${UNCONDITIONAL_API_FEED_REPO_INDEX}
ENV UNCONDITIONAL_API_FEED_REPO_HOST=${UNCONDITIONAL_API_FEED_REPO_HOST}
ENV UNCONDITIONAL_API_FEED_REPO_KEY=${UNCONDITIONAL_API_FEED_REPO_KEY}

ENTRYPOINT ["./app/main","serve", "--address", "0.0.0.0", "--port","8080", "--index","/data/index"]

0 comments on commit af6026b

Please sign in to comment.