-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
old-sqlite.Dockerfile
59 lines (44 loc) · 1.48 KB
/
old-sqlite.Dockerfile
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
52
53
54
55
56
57
# Build the Python distributable
FROM python:3.9-slim AS python-builder
WORKDIR /opt/prefect
# Install git for version calculation
RUN apt-get update && \
apt-get install --no-install-recommends -y \
git \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Copy the repository for version calculation
COPY . .
# Create source distribution
RUN python setup.py sdist && \
mv "dist/$(python setup.py --fullname).tar.gz" "dist/prefect.tar.gz"
# Final image
FROM python:3.9-slim
# Accept SQLite version as build argument
ARG SQLITE_VERSION="3310100"
ARG SQLITE_YEAR="2020"
# Install build dependencies
RUN apt-get update && apt-get install -y \
build-essential \
wget
# Download and compile SQLite
RUN wget https://www.sqlite.org/${SQLITE_YEAR}/sqlite-autoconf-${SQLITE_VERSION}.tar.gz \
&& tar xvfz sqlite-autoconf-${SQLITE_VERSION}.tar.gz \
&& cd sqlite-autoconf-${SQLITE_VERSION} \
&& ./configure \
&& make \
&& make install \
&& ldconfig \
&& cd .. \
&& rm -rf sqlite-autoconf-${SQLITE_VERSION}*
# Install uv for faster pip operations
COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
ENV UV_SYSTEM_PYTHON=1
# Set library path to use our compiled SQLite
ENV LD_LIBRARY_PATH=/usr/local/lib
WORKDIR /app
# Copy the built distributable
COPY --from=python-builder /opt/prefect/dist/prefect.tar.gz ./dist/
# Install requirements and Prefect
COPY requirements*.txt ./
RUN uv pip install -r requirements.txt
RUN uv pip install ./dist/prefect.tar.gz