This commit is contained in:
2025-02-19 12:35:41 +01:00
parent 7185a9c10d
commit 79ab9ecebb
5 changed files with 517 additions and 1 deletions

32
Dockerfile Normal file
View File

@@ -0,0 +1,32 @@
# Stage 1: Build the Go application
FROM golang:1.22.3 AS builder
# Set the working directory in the container
WORKDIR /app
# Copy the Go source code to the container
COPY . .
# Download necessary Go modules
RUN go mod download
# Build the application with CGO disabled for a static binary
RUN CGO_ENABLED=0 GOOS=linux go build -o airbyte-clickhouse-normer .
# Stage 2: Create a lightweight image with the Go binary
FROM alpine:latest
# Set the working directory in the container
WORKDIR /app
# Copy the binary from the builder stage
COPY --from=builder /app/airbyte-clickhouse-normer .
# Ensure binary has execute permissions
RUN chmod +x airbyte-clickhouse-normer
# Expose the port the app runs on (replace 8080 with your port)
EXPOSE 8080
# Set the command to run the application
CMD ["./airbyte-clickhouse-normer"]