initial commit
This commit is contained in:
34
Dockerfile
Normal file
34
Dockerfile
Normal file
@@ -0,0 +1,34 @@
|
||||
# Build Stage
|
||||
FROM golang:1.23-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy go mod and sum files
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
# Copy source code
|
||||
COPY . .
|
||||
|
||||
# Build the server binary
|
||||
# CGO_ENABLED=0 ensures a static binary
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -o grokway-server ./cmd/server
|
||||
|
||||
# Final Stage
|
||||
FROM alpine:latest
|
||||
|
||||
WORKDIR /root/
|
||||
|
||||
# Copy the binary from builder
|
||||
COPY --from=builder /app/grokway-server .
|
||||
|
||||
# Copy static files (needed for landing page checks)
|
||||
COPY --from=builder /app/cmd/server/static ./cmd/server/static
|
||||
|
||||
# Expose ports
|
||||
# 2222 for SSH Tunneling
|
||||
# 8080 for HTTP Proxy
|
||||
EXPOSE 2222 8080
|
||||
|
||||
# Run the binary
|
||||
CMD ["./grokway-server"]
|
||||
Reference in New Issue
Block a user