-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* EASI-3350: refactor Dockerfile * EASI-3353: TAG default value, ENV in single line * EASI-3352: ENV layer to single line * EASI-3355: db_seed change to golang:1.21-alpine * remove run-cypress-test-docker as unused and out of date * EASI-3355: remove unused dockerfile * linting * lint! i'm an idiot * EASI-3350: copy from base for certs and tzinfo for cache * EASI-3353: remove duplicative default value TAG=9.10 --------- Co-authored-by: Clay Benson <[email protected]>
- Loading branch information
1 parent
a672624
commit 78a6fb2
Showing
7 changed files
with
43 additions
and
126 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,47 @@ | ||
FROM golang:1.21 AS base | ||
|
||
WORKDIR /mint/ | ||
|
||
# Copy certificates | ||
COPY config/tls/*.crt /usr/local/share/ca-certificates/ | ||
RUN update-ca-certificates && \ | ||
apt install tzdata && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy go.mod and go.sum files to the workspace and download dependencies | ||
COPY go.mod ./ | ||
COPY go.sum ./ | ||
RUN go mod download | ||
WORKDIR /mint/ | ||
|
||
# Copy certificates | ||
COPY config/tls/*.crt /usr/local/share/ca-certificates/ | ||
RUN update-ca-certificates && \ | ||
apt update && \ | ||
apt install -y tzdata && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Copy go.mod and go.sum files to the workspace and download dependencies | ||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
FROM base AS dev | ||
|
||
# Install delve, gopls, and air for debugging | ||
RUN go install github.com/go-delve/delve/cmd/dlv@latest && \ | ||
go install golang.org/x/tools/gopls@latest && \ | ||
go install github.com/cosmtrek/air@4612c12f1ed7c899314b8430bc1d841ca2cb061a | ||
# Install delve, gopls, and air for debugging | ||
RUN go install github.com/go-delve/delve/cmd/dlv@latest && \ | ||
go install golang.org/x/tools/gopls@latest && \ | ||
go install github.com/cosmtrek/air@4612c12f1ed7c899314b8430bc1d841ca2cb061a | ||
|
||
FROM base AS build | ||
|
||
COPY cmd ./cmd | ||
COPY pkg ./pkg | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin/mint ./cmd/mint | ||
COPY cmd/ pkg/ ./ | ||
RUN CGO_ENABLED=0 GOOS=linux go build -a -o bin/mint ./cmd/mint | ||
|
||
FROM scratch | ||
|
||
WORKDIR /mint/ | ||
|
||
COPY --from=build /mint/bin/mint . | ||
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=build /usr/share/zoneinfo /usr/share/zoneinfo | ||
WORKDIR /mint/ | ||
|
||
# Copy build args to envs for version, datetime, and timestamp | ||
ARG ARG_APPLICATION_VERSION | ||
ARG ARG_APPLICATION_DATETIME | ||
ARG ARG_APPLICATION_TS | ||
ENV APPLICATION_VERSION=${ARG_APPLICATION_VERSION} | ||
ENV APPLICATION_DATETIME=${ARG_APPLICATION_DATETIME} | ||
ENV APPLICATION_TS=${ARG_APPLICATION_TS} | ||
COPY --from=base /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | ||
COPY --from=base /usr/share/zoneinfo /usr/share/zoneinfo | ||
COPY --from=build /mint/bin/mint ./ | ||
|
||
USER 1000 | ||
# Copy build args to envs for version, datetime, and timestamp | ||
ARG ARG_APPLICATION_VERSION | ||
ARG ARG_APPLICATION_DATETIME | ||
ARG ARG_APPLICATION_TS | ||
ENV APPLICATION_VERSION=${ARG_APPLICATION_VERSION} \ | ||
APPLICATION_DATETIME=${ARG_APPLICATION_DATETIME} \ | ||
APPLICATION_TS=${ARG_APPLICATION_TS} | ||
|
||
ENTRYPOINT ["/mint/mint"] | ||
USER 1000 | ||
|
||
CMD ["serve"] | ||
ENTRYPOINT ["/mint/mint"] | ||
CMD ["serve"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
FROM flyway/flyway:9.10-alpine | ||
|
||
ENV FLYWAY_CONNECT_RETRIES=10 | ||
ENV FLYWAY_IGNORE_INVALID_MIGRATION_NAMES="false" | ||
ENV FLYWAY_SCHEMAS=audit,public | ||
ENV FLYWAY_DEFAULT_SCHEMA=public | ||
ENV FLYWAY_CLEAN_DISABLED="false" | ||
ENV FLYWAY_CONNECT_RETRIES=10 \ | ||
FLYWAY_IGNORE_INVALID_MIGRATION_NAMES="false" \ | ||
FLYWAY_SCHEMAS=audit,public \ | ||
FLYWAY_DEFAULT_SCHEMA=public \ | ||
FLYWAY_CLEAN_DISABLED="false" | ||
|
||
ENTRYPOINT ["flyway", "clean"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
ARG TAG= | ||
ARG TAG=9.10 | ||
FROM flyway/flyway:${TAG} | ||
|
||
COPY migrations/ /flyway/sql | ||
|
||
ENV FLYWAY_CONNECT_RETRIES=10 | ||
ENV FLYWAY_CLEAN_DISABLED="true" | ||
ENV FLYWAY_SCHEMAS=public | ||
ENV FLYWAY_DEFAULT_SCHEMA=public | ||
ENV FLYWAY_CONNECT_RETRIES=10 \ | ||
FLYWAY_CLEAN_DISABLED="true" \ | ||
FLYWAY_SCHEMAS=public \ | ||
FLYWAY_DEFAULT_SCHEMA=public | ||
|
||
ENTRYPOINT ["flyway", "-validateMigrationNaming=true", "migrate" ] | ||
ENTRYPOINT ["flyway", "-validateMigrationNaming=true", "migrate"] |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.