-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathDockerfile.lite
More file actions
67 lines (55 loc) · 2.25 KB
/
Dockerfile.lite
File metadata and controls
67 lines (55 loc) · 2.25 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
FROM continuumio/miniconda3:24.11.1-0 AS cheminf-python-ms
# ---------- build-time proxy args ----------
ENV PYTHON_VERSION=3.11 \
INCLUDE_OCSR=false \
WORKERS=1 \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
http_proxy=${http_proxy} \
https_proxy=${https_proxy} \
no_proxy=${no_proxy} \
HTTP_PROXY=${http_proxy} \
HTTPS_PROXY=${https_proxy} \
NO_PROXY=${no_proxy}
# Optional: help APT when /etc/apt/apt.conf.d is respected (env is usually enough)
# RUN printf 'Acquire::http::Proxy "%s";\nAcquire::https::Proxy "%s";\n' "$http_proxy" "$https_proxy" \
# > /etc/apt/apt.conf.d/80proxy
# Install runtime dependencies
RUN apt-get update && \
apt-get install -y --no-install-recommends \
software-properties-common \
openjdk-17-jre-headless \
curl \
build-essential \
wget && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
# Create arch-independent JAVA_HOME symlink
ln -sf /usr/lib/jvm/java-17-openjdk-$(dpkg --print-architecture) /usr/lib/jvm/java-17-openjdk && \
wget "https://github.com/StructureGenerator/surge/releases/download/v2.0/surge-linux-x86_64.tar.gz" && \
tar xzf surge-linux-x86_64.tar.gz && \
mv surge /usr/bin/surge && \
chmod +x /usr/bin/surge && \
rm surge-linux-x86_64.tar.gz
ENV JAVA_HOME=/usr/lib/jvm/java-17-openjdk/
ARG RELEASE_VERSION=1.0
ENV RELEASE_VERSION=${RELEASE_VERSION}
WORKDIR /code
COPY requirements_lite.txt .
# conda/pip will honor proxy env above
RUN conda install -c conda-forge python=${PYTHON_VERSION} sqlite --force-reinstall && \
python3 -m pip install --no-cache-dir -U pip setuptools && \
pip3 install --no-cache-dir -r requirements_lite.txt && \
pip3 install --no-cache-dir --no-deps chembl_structure_pipeline
COPY ./app /code/app
RUN useradd -m -r appuser && chown -R appuser:appuser /code
USER appuser
# ---------- runtime: keep proxies available for the app too ----------
# (pystow/urllib need them at runtime to fetch the JAR)
ENV HTTP_PROXY=${HTTP_PROXY} \
HTTPS_PROXY=${HTTPS_PROXY} \
NO_PROXY=${NO_PROXY} \
http_proxy=${http_proxy} \
https_proxy=${https_proxy} \
no_proxy=${no_proxy}
CMD ["sh", "-c", "uvicorn app.main:app --host 0.0.0.0 --port 80 --workers ${WORKERS}"]