This commit is contained in:
2026-03-10 20:23:54 +01:00
parent b8e6df3a04
commit e837a9a04e
18 changed files with 985 additions and 659 deletions

31
Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
# Build stage
FROM golang:1.26.1-alpine AS builder
WORKDIR /app
# Install dependencies
COPY go.mod ./
# COPY go.sum ./ # Uncomment if you have a go.sum file
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o bbs-server main.go
# Final stage
FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /root/
# Copy the binary from the builder stage
COPY --from=builder /app/bbs-server .
# Expose the port
EXPOSE 2323
# Run the binary
CMD ["./bbs-server"]