Skip to content

Commit 3973c53

Browse files
vsilentCopilot
andcommitted
build: switch to musl targets and rustls for portable binaries
- reqwest: use rustls-tls instead of native-tls (no OpenSSL dependency) - release.yml: build x86_64/aarch64-unknown-linux-musl (static binaries) - Dockerfile: update debian:buster-slim → bookworm-slim, drop libpq-dev Statically linked binaries work on any Linux distro including Alpine. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 7112a0b commit 3973c53

3 files changed

Lines changed: 8 additions & 11 deletions

File tree

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818
strategy:
1919
matrix:
2020
include:
21-
- target: x86_64-unknown-linux-gnu
21+
- target: x86_64-unknown-linux-musl
2222
artifact: stackdog-linux-x86_64
23-
- target: aarch64-unknown-linux-gnu
23+
- target: aarch64-unknown-linux-musl
2424
artifact: stackdog-linux-aarch64
2525

2626
steps:

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ r2d2 = "0.8"
4848
bollard = "0.16"
4949

5050
# HTTP client (for LLM API)
51-
reqwest = { version = "0.12", features = ["json", "blocking"] }
51+
reqwest = { version = "0.12", default-features = false, features = ["json", "blocking", "rustls-tls"] }
5252

5353
# Compression
5454
zstd = "0.13"

docker/prod/Dockerfile

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
# base image
2-
FROM debian:buster-slim
2+
FROM debian:bookworm-slim
33

4-
# create app directory
5-
RUN mkdir app
64
WORKDIR /app
75

8-
# install libpq
9-
RUN apt-get update; \
10-
apt-get install --no-install-recommends -y libpq-dev; \
6+
# install ca-certificates for HTTPS requests
7+
RUN apt-get update && \
8+
apt-get install --no-install-recommends -y ca-certificates && \
119
rm -rf /var/lib/apt/lists/*
1210

1311
# copy binary and configuration files
1412
COPY ./stackdog .
1513
COPY ./.env .
16-
# expose port
14+
1715
EXPOSE 5000
1816

19-
# run the binary
2017
ENTRYPOINT ["/app/stackdog"]

0 commit comments

Comments
 (0)