konulu-konum-backend/Dockerfile
log101 47a9affc32
All checks were successful
/ build-and-push-image (push) Successful in 1m22s
fix(ci): create public directory for photos
2024-08-04 15:14:58 +03:00

30 lines
513 B
Docker

FROM golang:1.22.3-alpine AS builder
WORKDIR /usr/src/app
RUN apk update
RUN apk add build-base vips vips-dev
# pre-copy/cache go.mod for pre-downloading dependencies and only redownloading them in subsequent builds if they change
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN CGO_ENABLED=1 go build -v -o konulukonum
RUN go test -v ./...
FROM alpine
WORKDIR /root/app
RUN apk update
RUN apk add vips
COPY --from=builder /usr/src/app .
RUN mkdir public
CMD ["./konulukonum"]