File tree Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Expand file tree Collapse file tree 3 files changed +43
-1
lines changed Original file line number Diff line number Diff line change 1+ # --- Build stage ---
2+ FROM golang:latest AS builder
3+
4+ WORKDIR /app
5+
6+ COPY go.mod go.sum ./
7+ RUN go mod download
8+
9+ COPY . .
10+
11+ RUN make
12+
13+ # --- Final image ---
14+ FROM debian:latest
15+
16+ WORKDIR /app
17+
18+ # Copy binary and config
19+ COPY --from=builder /app/bin/laclm ./bin/laclm
20+ COPY config.yaml .
21+ COPY .env .
22+
23+ # Install `bash` to source the env file
24+ RUN apt-get update && apt-get install -y bash && rm -rf /var/lib/apt/lists/*
25+
26+ EXPOSE 8080
27+
28+ # Use a wrapper script to load env vars and run the binary
29+ COPY docker-entrypoint.sh .
30+
31+ RUN chmod +x docker-entrypoint.sh
32+
33+ ENTRYPOINT ["./docker-entrypoint.sh" ]
Original file line number Diff line number Diff line change 88
99# backend server deployment configs
1010server :
11- host : localhost
11+ host : 0.0.0.0
1212 port : 8080
1313
1414# databases for operations
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+
3+ # Load env vars
4+ if [ -f .env ]; then
5+ export $( grep -v ' ^#' .env | xargs)
6+ fi
7+
8+ # Run the binary
9+ exec ./bin/laclm --config config.yaml
You can’t perform that action at this time.
0 commit comments