Files
gosearch/Dockerfile
Renovate Bot c9b02fe8eb
Some checks failed
Go / build (pull_request) Successful in 11s
SonarQube Scan / Build and analyze (pull_request) Failing after 21s
Go / build (push) Successful in 10s
renovate / renovate (push) Successful in 1m24s
SonarQube Scan / Build and analyze (push) Failing after 16s
chore(deps): update golang docker tag to v1.26
2026-02-11 00:01:34 +00:00

26 lines
639 B
Docker

# Use the official Golang image for building
FROM golang:1.26 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:3.23
# Set working directory in the container
WORKDIR /
# Copy the built binary from the builder stage
COPY --from=builder /app/gosearch .
# Add executing User
RUN addgroup gosearch \
&& useradd -g gosearch gosearch
USER gosearch
# Expose the application port
EXPOSE 3000
# Run the application
CMD ["./gosearch"]