...and we need this as well for docker deployment

This commit is contained in:
@s.roertgen 2025-04-25 15:21:52 +02:00
parent c445b5b3ef
commit 0803aa6e90
2 changed files with 35 additions and 0 deletions

1
.dockerignore Normal file
View file

@ -0,0 +1 @@
go.work*

34
Dockerfile.relay Normal file
View file

@ -0,0 +1,34 @@
FROM golang:1.24.1-alpine AS builder
WORKDIR /app
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download all dependencies
RUN go mod download
# Copy the source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -o amb-relay .
# Start a new stage from scratch
FROM alpine:latest
WORKDIR /root/
# Install netcat for health checking
RUN apk add --no-cache netcat-openbsd
# Copy the binary from the builder stage
COPY --from=builder /app/amb-relay .
COPY .env ./
# Expose port 3334
EXPOSE 3334
# Command to run the executable
CMD ["./amb-relay"]