mirror of
https://github.com/edufeed-org/amb-relay.git
synced 2025-12-07 15:24:33 +00:00
...and we need this as well for docker deployment
This commit is contained in:
parent
c445b5b3ef
commit
0803aa6e90
2 changed files with 35 additions and 0 deletions
1
.dockerignore
Normal file
1
.dockerignore
Normal file
|
|
@ -0,0 +1 @@
|
|||
go.work*
|
||||
34
Dockerfile.relay
Normal file
34
Dockerfile.relay
Normal 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"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue