Removed unused stuff from dockerfile

This commit is contained in:
Nicolai Ort 2023-02-24 21:03:50 +01:00
parent 0a2ef56854
commit 4e19398db3
Signed by: niggl
GPG Key ID: 13AFA55AF62F269F

View File

@ -1,8 +1,6 @@
# === BUILD STAGE === # # === BUILD STAGE === #
FROM golang:1.20-alpine3.16 as build FROM golang:1.20-alpine3.16 as build
RUN apk add --no-cache git
WORKDIR /srv/app WORKDIR /srv/app
ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64 ENV CGO_ENABLED=0 GOOS=linux GOARCH=amd64
@ -10,8 +8,7 @@ COPY go.mod go.sum ./
RUN go mod download RUN go mod download
COPY . . COPY . .
RUN go test -v ./... RUN go test -v ./... && go build -ldflags="-w -s" -o build
RUN go build -ldflags="-w -s" -o build
# === RUN STAGE === # # === RUN STAGE === #
FROM registry.odit.services/hub/library/alpine:3.16 as run FROM registry.odit.services/hub/library/alpine:3.16 as run
@ -25,7 +22,6 @@ RUN apk update \
WORKDIR /srv/app WORKDIR /srv/app
COPY --from=build /srv/app/build /srv/app/build COPY --from=build /srv/app/build /srv/app/build
ENV LISTEN_ADDRESS 0.0.0.0:8080 ENV LISTEN_ADDRESS=0.0.0.0:8080 GIN_MODE=release
ENV GIN_MODE release
CMD ["/srv/app/build"] CMD ["/srv/app/build"]