Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(Dockerfile): optimize container image #34

Merged
merged 1 commit into from
Mar 20, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,28 +1,26 @@
FROM golang:1.20-alpine as build-stage

LABEL name "NezukoChan Image Proxy (Docker Build)"
LABEL maintainer "KagChi"

WORKDIR /tmp/build

COPY . .

# Install needed deps
RUN apk add libc-dev vips-dev gcc g++ make
RUN apk add --no-cache libc-dev vips-dev gcc g++ make

# Build the project
RUN go build cmd/server/main.go

FROM golang:1.20-alpine
FROM alpine:3

LABEL name "NezukoChan Image Proxy"
LABEL maintainer "KagChi"

WORKDIR /app

# Install needed deps
RUN apk add vips
RUN apk add --no-cache vips tini

COPY --from=build-stage /tmp/build/main main

CMD ["./main"]
ENTRYPOINT ["tini", "--"]
CMD ["/app/main"]