Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjooon2 committed Sep 13, 2024
1 parent b949f7f commit 88d9330
Showing 1 changed file with 15 additions and 10 deletions.
25 changes: 15 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
FROM golang:1.22.5 AS builder
FROM golang:alpine AS builder

WORKDIR /app
ENV GO111MODULE=on \
CGO_ENABLED=0 \
GOOS=linux \
GOARCH=amd64

COPY go.mod go.sum ./
WORKDIR /build

RUN go mod download
COPY go.mod go.sum ./cmd/main.go ./

COPY . .
RUN go mod download
RUN go build -o techbloghub-server .

RUN CGO_ENABLED=0 GOOS=linux go build -o myapp .
WORKDIR /dist

FROM alpine:latest
RUN cp /build/techbloghub-server .

WORKDIR /root/
FROM scratch

COPY --from=builder /app/myapp .
COPY --from=builder /dist/techbloghub-server /techbloghub-server

CMD ["./myapp"]
EXPOSE 8080
ENTRYPOINT ["/techbloghub-server"]

0 comments on commit 88d9330

Please sign in to comment.