Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
fix: docker image error
Browse files Browse the repository at this point in the history
  • Loading branch information
AH-dark committed Jan 6, 2024
1 parent b60f7e7 commit a3850c3
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions docker/application/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,32 +1,28 @@
FROM golang:1.21 AS builder
FROM golang:1.21-bullseye AS builder
ARG COMPONENT=main

WORKDIR /go/src/app

# Install dependencies
RUN apt update && apt install -y \
make \
gcc \
libwebp-dev
RUN apt update && apt install -y libwebp-dev
COPY go.mod go.sum ./
RUN go mod download

# Copy source code
COPY . .

# Build the app
RUN make build-${COMPONENT}
RUN go build -o bin/application cmd/${COMPONENT}/main.go

FROM alpine AS runner
ARG COMPONENT=main
FROM bitnami/minideb:bullseye AS runner

WORKDIR /app

# Install dependencies
RUN apk add --no-cache ca-certificates libwebp libwebp-tools
RUN apt update && apt install -y libwebp-dev ca-certificates

# Copy the binary from the build stage
COPY --from=builder /go/src/app/bin/${COMPONENT} /app/application
COPY --from=builder /go/src/app/bin/application /app/application

# Run the binary
ENTRYPOINT /app/application

0 comments on commit a3850c3

Please sign in to comment.