fs3/backend/Dockerfile
rdev-worker 296401abbc
Some checks are pending
ci/woodpecker/push/woodpecker Pipeline is pending
build: Build a full-stack task management application with the following str...
2026-01-31 07:44:20 +00:00

32 lines
488 B
Docker

# Build stage
FROM golang:1.22-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod go.sum* ./
RUN go mod download
# Copy source code
COPY . .
# Build the binary
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o main .
# Final stage
FROM alpine:3.19
WORKDIR /app
# Install ca-certificates for HTTPS
RUN apk --no-cache add ca-certificates
# Copy binary from builder
COPY --from=builder /app/main .
# Expose port
EXPOSE 8081
# Run the binary
CMD ["./main"]