gosearch/Dockerfile
Renovate Bot 1efa028e37
Some checks failed
Go / build (pull_request) Successful in -10s
SonarQube Scan / Build and analyze (pull_request) Failing after 13s
chore(deps): update golang docker tag to v1.24
2025-03-26 15:25:43 +00:00

22 lines
555 B
Docker

# Use the official Golang image for building
FROM golang:1.24 AS builder
# Set working directory
WORKDIR /app
# Copy Go modules and dependencies
COPY go.mod go.sum ./
RUN go mod download
# Copy source code
COPY . .
# Build the application
RUN go build -o gosearch .
# Use a minimal base image for final deployment
FROM alpine:latest
# Set working directory in the container
WORKDIR /root/
# Copy the built binary from the builder stage
COPY --from=builder /app/gosearch .
# Expose the application port
EXPOSE 3000
# Run the application
CMD ["./gosearch"]