Skip to content

Commit b54c393

Browse files
committed
dockerfile
1 parent 3eb45e1 commit b54c393

File tree

2 files changed

+24
-31
lines changed

2 files changed

+24
-31
lines changed

Dockerfile

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
# Build aşaması
1+
# Build stage
22
FROM 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
813
WORKDIR /app
@@ -15,18 +20,27 @@ RUN go mod download
1520
COPY . .
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
2126
FROM 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
2937
COPY --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"]

docker-compose.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

0 commit comments

Comments
 (0)