-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
74 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# this dockerfile should be built from the root of the repository like: | ||
# docker build . -f cmd/tunnel-server/Dockerfile | ||
FROM golang:1.23-bullseye AS builder | ||
WORKDIR /build | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
# Build the application | ||
RUN go build -o /opt/tunnel-server ./cmd/tunnel-server | ||
|
||
# Use a minimal image for running the application | ||
FROM debian:bullseye-slim | ||
|
||
# Copy the compiled binary | ||
COPY --from=builder /opt/tunnel-server /opt/tunnel-server | ||
|
||
# Command to run the binary | ||
CMD ["/opt/tunnel-server"] |