Skip to content

Commit 57f4524

Browse files
Added basic dockerfile and tested images successfully - ready to be pushed into docker-compose for setting up test rig
1 parent 87210de commit 57f4524

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

Dockerfile

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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"]

config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ app:
88

99
# backend server deployment configs
1010
server:
11-
host: localhost
11+
host: 0.0.0.0
1212
port: 8080
1313

1414
# databases for operations

docker-entrypoint.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
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

0 commit comments

Comments
 (0)