mirror of
https://github.com/Maronato/go-finger.git
synced 2025-03-15 00:34:47 +00:00
Add missing paths to dockerfile
This commit is contained in:
parent
de3da93523
commit
8673f0db42
1 changed files with 54 additions and 52 deletions
106
Dockerfile
106
Dockerfile
|
@ -1,52 +1,54 @@
|
|||
# Load golang image
|
||||
FROM golang:1.21-alpine as builder
|
||||
|
||||
RUN apk add make
|
||||
|
||||
ARG VERSION=undefined
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
# Set our build environment
|
||||
ENV GOCACHE=/tmp/.go-build-cache
|
||||
# This variable communicates to the service that it's running inside
|
||||
# a docker container.
|
||||
ENV ENV_DOCKER=true
|
||||
|
||||
# Copy dockerignore files
|
||||
COPY .dockerignore ./
|
||||
|
||||
# Install go deps using the cache
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
go mod download -x
|
||||
|
||||
COPY Makefile ./
|
||||
|
||||
# Copy source files
|
||||
COPY main.go ./
|
||||
COPY cmd cmd
|
||||
COPY internal internal
|
||||
|
||||
# Build it
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
make build VERSION=$VERSION
|
||||
|
||||
# Now create a new image with just the binary
|
||||
FROM gcr.io/distroless/static-debian11:nonroot
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY urns.yml /app/urns.yml
|
||||
|
||||
# Set our runtime environment
|
||||
ENV ENV_DOCKER=true
|
||||
|
||||
COPY --from=builder /go/src/app/finger /usr/local/bin/finger
|
||||
|
||||
HEALTHCHECK CMD [ "finger", "healthcheck" ]
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT [ "finger" ]
|
||||
CMD [ "serve" ]
|
||||
# Load golang image
|
||||
FROM golang:1.21-alpine as builder
|
||||
|
||||
RUN apk add make
|
||||
|
||||
ARG VERSION=undefined
|
||||
|
||||
WORKDIR /go/src/app
|
||||
|
||||
# Set our build environment
|
||||
ENV GOCACHE=/tmp/.go-build-cache
|
||||
# This variable communicates to the service that it's running inside
|
||||
# a docker container.
|
||||
ENV ENV_DOCKER=true
|
||||
|
||||
# Copy dockerignore files
|
||||
COPY .dockerignore ./
|
||||
|
||||
# Install go deps using the cache
|
||||
COPY go.mod go.sum ./
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
go mod download -x
|
||||
|
||||
COPY Makefile ./
|
||||
|
||||
# Copy source files
|
||||
COPY main.go ./
|
||||
COPY cmd cmd
|
||||
COPY internal internal
|
||||
COPY webfingers webfingers
|
||||
COPY handler handler
|
||||
|
||||
# Build it
|
||||
RUN --mount=type=cache,target=/tmp/.go-build-cache \
|
||||
make build VERSION=$VERSION
|
||||
|
||||
# Now create a new image with just the binary
|
||||
FROM gcr.io/distroless/static-debian11:nonroot
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY urns.yml /app/urns.yml
|
||||
|
||||
# Set our runtime environment
|
||||
ENV ENV_DOCKER=true
|
||||
|
||||
COPY --from=builder /go/src/app/finger /usr/local/bin/finger
|
||||
|
||||
HEALTHCHECK CMD [ "finger", "healthcheck" ]
|
||||
|
||||
EXPOSE 8080
|
||||
|
||||
ENTRYPOINT [ "finger" ]
|
||||
CMD [ "serve" ]
|
||||
|
|
Loading…
Add table
Reference in a new issue