-
Notifications
You must be signed in to change notification settings - Fork 23
Expand file tree
/
Copy pathDockerfile
More file actions
51 lines (45 loc) · 1.8 KB
/
Copy pathDockerfile
File metadata and controls
51 lines (45 loc) · 1.8 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
FROM alpine:3.21
# System packages:
# build-base, cmake, flex, bison, readline-dev -> build SFST from source
# bash -> Makefile.inc sets SHELL := /bin/bash
# git -> setuptools-scm derives the package version from git tags
# python3, py3-pip, python3-dev -> python package + sfst musllinux wheel
# uv -> project dependency tooling (uv.lock)
# nodejs, npm -> build web frontend (docs:build via make docs)
# rustup -> Rust toolchain; Cargo.toml needs edition 2024 (Rust >= 1.85),
# newer than Alpine's packaged rust
RUN apk add --no-cache \
build-base \
cmake \
flex \
bison \
readline-dev \
bash \
git \
python3 \
py3-pip \
python3-dev \
uv \
nodejs \
npm \
rustup
# Alpine's system Python is PEP 668 "externally managed", but the project
# Makefile runs `pip install -e` directly, so allow system-level pip installs.
RUN rm -f /usr/lib/python3*/EXTERNALLY-MANAGED
# Rust toolchain via rustup (stable >= 1.85 for edition 2024).
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH
RUN rustup-init -y --no-modify-path --profile minimal --default-toolchain stable
# Build and install SFST from source — the Debian package is outdated.
# Installs fst-compiler-utf8 (used by Makefile.inc) to /usr/local/bin and
# libsfst to /usr/local/lib (on musl's default library search path).
RUN git clone --depth 1 https://github.com/santhoshtr/sfst.git /tmp/sfst \
&& cmake -S /tmp/sfst -B /tmp/sfst/build -DCMAKE_BUILD_TYPE=Release \
&& cmake --build /tmp/sfst/build --parallel \
&& cmake --install /tmp/sfst/build \
&& rm -rf /tmp/sfst
WORKDIR /app
COPY . /app
EXPOSE 8000
CMD ["make", "webserver"]