Skip to content

Commit

Permalink
chore: update dockerfile for use fly secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
luigibarbato committed Mar 10, 2024
1 parent 1d60db9 commit df598ce
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
1 change: 0 additions & 1 deletion .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ on:
types: [published]

env:
UNCONDITIONAL_API_SOURCE_CLIENT_KEY: ${{ secrets.UNCONDITIONAL_API_SOURCE_CLIENT_KEY }}
UNCONDITIONAL_API_BUILD_COMMIT_VERSION: ${{ github.sha }}
UNCONDITIONAL_API_BUILD_RELEASE_VERSION: ${{ github.event.release.tag_name }}
FLY_API_TOKEN: ${{ secrets.FLY_API_TOKEN }}
Expand Down
17 changes: 3 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,22 +26,18 @@ WORKDIR /data
COPY --from=builder /app/main /app/main

ARG UNCONDITIONAL_API_SOURCE_REPO
ARG UNCONDITIONAL_API_SOURCE_CLIENT_KEY
ARG UNCONDITIONAL_API_FEED_REPO_INDEX
ARG UNCONDITIONAL_API_FEED_REPO_HOST
ARG UNCONDITIONAL_API_FEED_REPO_KEY
ARG UNCONDITIONAL_API_LOG_ENV

ENV UNCONDITIONAL_API_SOURCE_REPO=${UNCONDITIONAL_API_SOURCE_REPO}
ENV UNCONDITIONAL_API_SOURCE_CLIENT_KEY=${UNCONDITIONAL_API_SOURCE_CLIENT_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}
ENV UNCONDITIONAL_API_LOG_ENV=${UNCONDITIONAL_API_LOG_ENV}

RUN --mount=type=secret,id=UNCONDITIONAL_API_SOURCE_CLIENT_KEY \
--mount=type=secret,id=UNCONDITIONAL_API_FEED_REPO_HOST \
--mount=type=secret,id=UNCONDITIONAL_API_FEED_REPO_KEY \
UNCONDITIONAL_API_SOURCE_CLIENT_KEY="$(cat /run/secrets/UNCONDITIONAL_API_SOURCE_CLIENT_KEY)" \
UNCONDITIONAL_API_FEED_REPO_HOST="$(cat /run/secrets/UNCONDITIONAL_API_FEED_REPO_HOST)" \
UNCONDITIONAL_API_FEED_REPO_KEY="$(cat /run/secrets/UNCONDITIONAL_API_FEED_REPO_KEY)" \
/app/main index create --name feeds

Expand All @@ -54,20 +50,13 @@ ARG UNCONDITIONAL_API_ADDRESS
ARG UNCONDITIONAL_API_ALLOWED_ORIGINS
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"]

0 comments on commit df598ce

Please sign in to comment.