Files
syops/backend/Dockerfile
T
2026-05-12 18:36:12 +08:00

29 lines
852 B
Docker

FROM python:3.12-slim-bookworm
WORKDIR /app
# Oracle Instant Client runtime dependencies for thick mode.
# `libaio1` is available on Debian bookworm, while newer variants may expose `libaio1t64`.
RUN apt-get update \
&& (apt-get install -y --no-install-recommends libaio1 libnsl2 \
|| apt-get install -y --no-install-recommends libaio1t64 libnsl2) \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY . .
ENV ORACLE_HOME=/app/oracle_client/instantclient_19_31
ENV LD_LIBRARY_PATH=/app/oracle_client/instantclient_19_31:/app/oracle_client:${LD_LIBRARY_PATH}
# Expose port 5000
EXPOSE 5000
# Start Gunicorn
# Using the config file we created earlier
CMD ["gunicorn", "-c", "deploy/gunicorn_config.py", "run:app"]