fix: keep libssl3 runtime dependency to prevent TLS errors in container
All checks were successful
continuous-integration/drone/push Build is passing

autoremove was removing SSL runtime libraries after purging gcc/g++,
causing curl_cffi TLS handshake failures when connecting to Yahoo Finance.
Explicitly install libssl3 as runtime dep and only purge libssl-dev.
This commit is contained in:
Yaojia Wang
2026-03-19 13:25:58 +01:00
parent 760b0a09ea
commit b631c888a5

View File

@@ -3,7 +3,9 @@ FROM python:3.12-slim AS base
WORKDIR /app WORKDIR /app
RUN apt-get update && \ RUN apt-get update && \
apt-get install -y --no-install-recommends gcc g++ ca-certificates libssl-dev curl libnss3 && \ apt-get install -y --no-install-recommends \
gcc g++ libssl-dev \
ca-certificates curl libnss3 libssl3 && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
COPY pyproject.toml ./ COPY pyproject.toml ./
@@ -11,7 +13,7 @@ COPY pyproject.toml ./
RUN pip install --no-cache-dir . && \ RUN pip install --no-cache-dir . && \
pip install --no-cache-dir openbb-quantitative openbb-econometrics openbb-technical && \ pip install --no-cache-dir openbb-quantitative openbb-econometrics openbb-technical && \
pip install --no-cache-dir --upgrade curl_cffi && \ pip install --no-cache-dir --upgrade curl_cffi && \
apt-get purge -y gcc g++ && \ apt-get purge -y gcc g++ libssl-dev && \
apt-get autoremove -y apt-get autoremove -y
COPY *.py ./ COPY *.py ./