forked from tursodatabase/libsql-python
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
32 lines (23 loc) · 728 Bytes
/
Dockerfile
File metadata and controls
32 lines (23 loc) · 728 Bytes
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
FROM rust:slim-bullseye as builder
RUN apt update && apt install -y \
build-essential git python3-dev python3-pip python3-venv \
&& mkdir /pylibsql /pyenv \
&& python3 -m venv /pyenv \
&& . /pyenv/bin/activate \
&& pip install maturin patchelf pytest
COPY src/ /pylibsql/src/.
COPY tests/ /pylibsql/tests/.
COPY pyproject.toml /pylibsql/.
COPY Cargo.toml /pylibsql/.
COPY Cargo.lock /pylibsql/.
WORKDIR /pylibsql
RUN . /pyenv/bin/activate \
&& maturin develop --release \
&& pytest
FROM debian:bullseye-slim as runtime
RUN apt update && apt install -y \
python3 python3-venv
COPY --from=builder /pyenv /pyenv
COPY tests/ /pylibsql/tests/.
WORKDIR /pylibsql
ENV PATH="/pyenv/bin:${PATH}"