-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.api
More file actions
55 lines (45 loc) · 1.36 KB
/
Dockerfile.api
File metadata and controls
55 lines (45 loc) · 1.36 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
FROM python:3.10-slim
WORKDIR /app
# Installer les dépendances système nécessaires
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libpq-dev \
wget \
ca-certificates \
unzip \
gcc \
g++ \
make \
pkg-config \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Télécharger et installer la bibliothèque native TA-Lib
RUN wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz && \
tar -xzf ta-lib-0.4.0-src.tar.gz && \
cd ta-lib && \
./configure --prefix=/usr && \
make && \
make install && \
cd .. && \
rm -rf ta-lib ta-lib-0.4.0-src.tar.gz && \
ldconfig
# Copier les fichiers de requirements
COPY requirements.txt .
# Installer les dépendances Python
RUN pip install --no-cache-dir --upgrade pip wheel setuptools && \
pip install --no-cache-dir -r requirements.txt && \
pip install --no-cache-dir TA-Lib>=0.4.28 && \
pip install --no-cache-dir PyJWT
# Copier le code source
COPY src/ /app/src/
# Créer les répertoires nécessaires
RUN mkdir -p /app/logs /app/data
# Variables d'environnement
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PYTHONPATH=/app \
LD_LIBRARY_PATH=/usr/lib
# Exposer le port
EXPOSE 8000
# Commande de démarrage
CMD ["uvicorn", "src.api.app:create_app", "--host", "0.0.0.0", "--port", "8000"]