-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
62 lines (45 loc) · 1.45 KB
/
Copy pathDockerfile
File metadata and controls
62 lines (45 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
# Dockerfile for doltswarmdemo
# Build: ./build-docker.sh
# Run: docker run --rm -e PORT=10500 doltswarmdemo
# Build stage
FROM golang:latest AS builder
# Install ICU development libraries (required for dolt)
RUN apt-get update && apt-get install -y \
libicu-dev \
pkg-config \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
# Copy doltswarm library first
COPY doltswarm /build/doltswarm
# Copy go mod files
COPY doltswarmdemo/go.mod doltswarmdemo/go.sum /build/doltswarmdemo/
WORKDIR /build/doltswarmdemo
# Download dependencies (skip checksum for private repos)
ENV GONOSUMDB=github.com/nustiueudinastea/*
RUN go mod download
# Copy the source code
COPY doltswarmdemo/ /build/doltswarmdemo/
# Build the binary
RUN go build -o ddolt .
# Runtime stage - use trixie to match golang:latest ICU version (76)
FROM debian:trixie-slim
# Install ICU runtime libraries (required for dolt)
RUN apt-get update && apt-get install -y \
libicu76 \
ca-certificates \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /app
# Copy the binary from builder
COPY --from=builder /build/doltswarmdemo/ddolt /app/ddolt
# Default environment variables
ENV PORT=10500
ENV LISTEN_ADDR=0.0.0.0
ENV DB_PATH=/data
ENV LOG_LEVEL=info
# Expose the default port (can be overridden)
EXPOSE 10500
# Use entrypoint script for flexibility
COPY doltswarmdemo/docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["server"]