-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
58 lines (46 loc) · 1.72 KB
/
Copy pathDockerfile.server
File metadata and controls
58 lines (46 loc) · 1.72 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
# Production Dockerfile for Bio-Engine Server
FROM mirror.gcr.io/library/python:3.10-bullseye
# Build-time proxy ARGs
ARG HTTP_PROXY
ARG HTTPS_PROXY
ARG NO_PROXY
ARG http_proxy=$HTTP_PROXY
ARG https_proxy=$HTTPS_PROXY
ARG no_proxy=$NO_PROXY
# Copy custom CA certificates if any are provided (e.g. for HTTPS inspection proxy)
COPY certs/ /usr/local/share/ca-certificates/
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates
# Tell python tools (pip, requests) to use the system CA certificate bundle
ENV PIP_CERT=/etc/ssl/certs/ca-certificates.crt
ENV REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt
# Install bioinformatics tools and system dependencies
RUN apt-get update && apt-get install -y \
samtools \
tabix \
curl \
procps \
gcc \
libpq-dev \
python3-dev \
&& rm -rf /var/lib/apt/lists/*
# Download and install Tracy (bio-informatics tool)
RUN ARCH=$(uname -m) && \
if [ "$ARCH" = "x86_64" ]; then TRACY_ARCH="amd64"; else TRACY_ARCH="arm64"; fi && \
curl -L "https://github.com/gear-genomics/tracy/releases/download/v0.8.9/tracy-v0.8.9-linux-${TRACY_ARCH}" -o /usr/local/bin/tracy \
&& chmod +x /usr/local/bin/tracy
WORKDIR /app
# Copy requirements and install
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir python-multipart open-cravat
# Copy the rest of the application
COPY . .
# Create directory for persistent data
RUN mkdir -p /app/data
# Environment variables for the sidecar paths
ENV BIO_SAMTOOLS_PATH=samtools
ENV BIO_BGZIP_PATH=bgzip
ENV TRACY_PATH=tracy
EXPOSE 8000
# Run the FastAPI server
CMD ["python", "main.py", "--host", "0.0.0.0", "--port", "8000", "--data-dir", "/app/storage"]