-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
40 lines (28 loc) · 992 Bytes
/
Dockerfile
File metadata and controls
40 lines (28 loc) · 992 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
32
33
34
35
36
37
38
39
40
FROM debian as build
RUN apt-get update && apt-get install -y build-essential curl
# Get sqlite 3.49
RUN mkdir -p /tmp/build/sqlite && \
curl -L https://www.sqlite.org/2025/sqlite-autoconf-3490100.tar.gz | \
tar xz -C /tmp/build/sqlite --strip-components=1 && \
cd /tmp/build/sqlite && \
./configure && \
make && \
make DESTDIR=/build/sqlite install
FROM python:3-slim as python-build
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
COPY requirements.txt .
RUN python -m venv /venv
RUN /venv/bin/pip install --no-cache-dir -r requirements.txt
FROM python:3-slim
COPY --from=build /build/sqlite /
ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
COPY --from=python-build /venv /venv
ENV PATH=/venv/bin:$PATH
# assert sqlite version
RUN python -c "import sqlite3; assert sqlite3.sqlite_version == '3.49.1'"
WORKDIR /usr/src/app
COPY migrations ./migrations
COPY collect.py .
COPY api.py .