yfinance curl calls failed with OPENSSL_internal:invalid library in python:3.12-slim. Adding ca-certificates, libssl-dev and curl ensures the OpenSSL libraries are available at runtime.
28 lines
733 B
Docker
28 lines
733 B
Docker
FROM python:3.12-slim AS base
|
|
|
|
WORKDIR /app
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends gcc g++ ca-certificates libssl-dev curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY pyproject.toml ./
|
|
|
|
RUN pip install --no-cache-dir . && \
|
|
pip install --no-cache-dir openbb-quantitative openbb-econometrics openbb-technical && \
|
|
apt-get purge -y gcc g++ && \
|
|
apt-get autoremove -y
|
|
|
|
COPY *.py ./
|
|
|
|
RUN useradd -m -s /bin/bash appuser && \
|
|
mkdir -p /home/appuser/.openbb_platform && \
|
|
chown -R appuser:appuser /home/appuser && \
|
|
chown -R appuser:appuser /usr/local/lib/python3.12/site-packages/openbb
|
|
|
|
EXPOSE 8000
|
|
|
|
USER appuser
|
|
|
|
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
|