File tree Expand file tree Collapse file tree 2 files changed +24
-31
lines changed
Expand file tree Collapse file tree 2 files changed +24
-31
lines changed Original file line number Diff line number Diff line change 1- # Build aşaması
1+ # Build stage
22FROM golang:1.23-bullseye AS builder
33
4- # Install the necessary build tools
5- RUN apt-get update && apt-get install -y git
4+ # Install necessary build tools
5+ RUN apt-get update && apt-get install -y \
6+ git \
7+ gcc \
8+ g++ \
9+ sqlite3 \
10+ && rm -rf /var/lib/apt/lists/*
611
712# Set working directory
813WORKDIR /app
@@ -15,18 +20,27 @@ RUN go mod download
1520COPY . .
1621
1722# Build the application
18- RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo - o sqlmapper .
23+ RUN CGO_ENABLED=1 GOOS=linux go build -o sqlmapper ./cmd/sqlmapper
1924
20- # Run stage
25+ # Final stage
2126FROM debian:bullseye-slim
2227
23- # Install necessary packages for SSL certificates
24- RUN apt-get update && apt-get install -y ca-certificates
28+ # Install runtime dependencies
29+ RUN apt-get update && apt-get install -y \
30+ ca-certificates \
31+ sqlite3 \
32+ && rm -rf /var/lib/apt/lists/*
2533
26- WORKDIR /root/
34+ WORKDIR /app
2735
28- # Copy the built application from the builder stage
36+ # Copy the built application from builder stage
2937COPY --from=builder /app/sqlmapper .
38+ COPY --from=builder /app/examples ./examples
39+
40+ # Set environment variables
41+ ENV PATH="/app:${PATH}"
42+ ENV SQLMAPPER_LOG_LEVEL=info
3043
3144# Run the application
32- CMD ["./sqlmapper" ]
45+ ENTRYPOINT ["./sqlmapper" ]
46+ CMD ["--help" ]
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments