-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
44 lines (32 loc) · 1.09 KB
/
Dockerfile
File metadata and controls
44 lines (32 loc) · 1.09 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
FROM debian AS sqlite-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-base
LABEL citybikes="true"
# Add build deps (git mainly)
RUN apt-get update && apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
# Create a virtualenv and set as default path
RUN python -m venv /venv
ENV PATH=/venv/bin:$PATH
# Add sqlite
COPY --from=sqlite-build /build/sqlite /
ENV LD_LIBRARY_PATH=/usr/local/lib:${LD_LIBRARY_PATH}
# assert sqlite version
RUN python -c "import sqlite3; assert sqlite3.sqlite_version == '3.49.1'"
FROM python-base
WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install -r requirements.txt
COPY config.py .
COPY api.py .
COPY api_v1.py .
CMD gunicorn api:app -w 4 -k uvicorn_worker.UvicornWorker -b 0.0.0.0:8000