Skip to content

Commit

Permalink
ㅅㄷㄴㅅ
Browse files Browse the repository at this point in the history
  • Loading branch information
iamjooon2 committed Sep 13, 2024
1 parent 3f4ab5a commit e46d16e
Showing 1 changed file with 5 additions and 17 deletions.
22 changes: 5 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,18 @@
# syntax=docker/dockerfile:1

# Build the application from source
FROM golang:1.22 AS build-stage
FROM golang:1.22.5 AS build-stage

WORKDIR /app

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

COPY *.go ./
RUN go mod tidy

RUN CGO_ENABLED=0 GOOS=linux go build -o /techbloghub
COPY . .

# Run the tests in the container
FROM build-stage AS run-test-stage
RUN go test -v ./...

# Deploy the application binary into a lean image
FROM gcr.io/distroless/base-debian11 AS build-release-stage

WORKDIR /

COPY --from=build-stage /techbloghub /techbloghub
RUN go build -o main ./main.go

EXPOSE 8080

USER nonroot:nonroot

ENTRYPOINT ["//techbloghub"]
ENTRYPOINT ["/techbloghub"]

0 comments on commit e46d16e

Please sign in to comment.