Files
cv-site/Dockerfile
T
juanatsap ee354d1d35 refactor: standardize port to 1999 across all files
- Updated default port from 8080 to 1999 in config, Docker, and documentation files
- Modified example URLs and test commands to use new port
- Ensured consistent port references in environment configs and deployment examples
- Updated health check endpoints in Docker and testing scripts

The port change aligns with LIV Golf port allocation standards for staging environments (5000-9999 range).
2025-10-29 14:04:24 +00:00

47 lines
841 B
Docker

# Build stage
FROM golang:1.25-alpine AS builder
WORKDIR /app
# Copy go mod files
COPY go.mod ./
# Download dependencies
RUN go mod download
# Copy source code
COPY . .
# Build binary
RUN CGO_ENABLED=0 GOOS=linux go build -o cv-server -ldflags="-s -w" .
# Runtime stage
FROM alpine:latest
# Install CA certificates for HTTPS
RUN apk --no-cache add ca-certificates
WORKDIR /root/
# Copy binary from builder
COPY --from=builder /app/cv-server .
# Copy application files
COPY templates templates/
COPY data data/
COPY static static/
# Expose port
EXPOSE 1999
# Set production environment
ENV GO_ENV=production
ENV PORT=1999
# Health check
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget --no-verbose --tries=1 --spider http://localhost:1999/health || exit 1
# Run the binary
CMD ["./cv-server"]