build sqlite-zstd from source to not have a version missmatch of sqlite3
Build and Push Docker Container / build-and-push (push) Successful in 4m14s
Build and Push Docker Container / build-and-push (push) Successful in 4m14s
This commit is contained in:
+19
-4
@@ -1,10 +1,26 @@
|
|||||||
|
# Stage 1 — compile sqlite-zstd against the container's own SQLite
|
||||||
|
FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim AS sqlite-zstd-builder
|
||||||
|
|
||||||
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
|
curl git libsqlite3-dev libzstd-dev pkg-config build-essential ca-certificates && \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y --default-toolchain stable --profile minimal
|
||||||
|
ENV PATH="/root/.cargo/bin:${PATH}"
|
||||||
|
|
||||||
|
RUN git clone --depth=1 --branch v0.3.5 https://github.com/phiresky/sqlite-zstd.git /tmp/sqlite-zstd && \
|
||||||
|
cd /tmp/sqlite-zstd && \
|
||||||
|
cargo build --release --features build_extension && \
|
||||||
|
cp target/release/libsqlite_zstd.so /usr/local/lib/libsqlite_zstd.so
|
||||||
|
|
||||||
|
# Stage 2 — runtime image
|
||||||
FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim
|
FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends curl libzstd1 && \
|
RUN apt-get update && apt-get install -y --no-install-recommends libzstd1 && \
|
||||||
curl -fsSL "https://github.com/phiresky/sqlite-zstd/releases/download/v0.3.5/sqlite_zstd-v0.3.5-x86_64-unknown-linux-gnu.tar.gz" \
|
|
||||||
| tar -xz --strip-components=1 -C /usr/local/lib "sqlite_zstd-v0.3.5-x86_64-unknown-linux-gnu/libsqlite_zstd.so" && \
|
|
||||||
rm -rf /var/lib/apt/lists/*
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
COPY --from=sqlite-zstd-builder /usr/local/lib/libsqlite_zstd.so /usr/local/lib/libsqlite_zstd.so
|
||||||
|
|
||||||
# Install app
|
# Install app
|
||||||
COPY . /app
|
COPY . /app
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
@@ -12,7 +28,6 @@ WORKDIR /app
|
|||||||
# Install dependencies
|
# Install dependencies
|
||||||
RUN uv sync --no-config --frozen --compile-bytecode
|
RUN uv sync --no-config --frozen --compile-bytecode
|
||||||
|
|
||||||
# Starten Sie Ihre Anwendung
|
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
|
|
||||||
CMD [".venv/bin/hypercorn", "asgi:app", "--bind", "0.0.0.0:8000", "--workers", "1", "--access-logfile", "-"]
|
CMD [".venv/bin/hypercorn", "asgi:app", "--bind", "0.0.0.0:8000", "--workers", "1", "--access-logfile", "-"]
|
||||||
|
|||||||
Reference in New Issue
Block a user