Skip to content

Commit

Permalink
Add Docker file
Browse files Browse the repository at this point in the history
  • Loading branch information
rakyll committed Sep 9, 2024
1 parent b45b8a7 commit 900dbf5
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
FROM golang AS builder
WORKDIR /go/src/proxy-to-gemini
ADD . ./
RUN CGO_ENABLED=0 go build -ldflags '-extldflags "-static"' -o /proxy-to-gemini
WORKDIR /go/code
ADD . /go/code
RUN CGO_ENABLED=0 go build -o /proxy ./cmd/proxy-to-gemini

FROM scratch
COPY --from=builder /proxy-to-gemini /proxy-to-gemini
COPY --from=builder /proxy /proxy-to-gemini
ENTRYPOINT ["/proxy-to-gemini"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
DOCKER_IMAGE = "googlegemini/proxy-to-gemini"

build:
docker build -t $(DOCKER_IMAGE) .

publish: build
docker push $(DOCKER_IMAGE)

run: build
docker run -p 5555:5555 -e GEMINI_API_KEY=$GEMINI_API_KEY $(DOCKER_IMAGE)

0 comments on commit 900dbf5

Please sign in to comment.