|
|
|
FROM python:3.11-slim |
|
|
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
git \ |
|
curl \ |
|
wget \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
|
|
COPY requirements.txt . |
|
|
|
|
|
RUN pip install --no-cache-dir -r requirements.txt |
|
|
|
|
|
COPY . . |
|
|
|
|
|
RUN mkdir -p /app/logs && \ |
|
touch /app/log.txt && \ |
|
chmod 666 /app/log.txt |
|
RUN pip3 install uvicorn fastapi |
|
|
|
|
|
EXPOSE 8080 |
|
|
|
|
|
ENV PYTHONPATH=/app |
|
ENV PORT=8080 |
|
|
|
|
|
|
|
|
|
|
|
HEALTHCHECK --interval=30s --timeout=30s --start-period=5s --retries=3 \ |
|
CMD curl -f http://localhost:8080/ || exit 1 |
|
|
|
|
|
COPY start.sh /app/start.sh |
|
RUN chmod +x /app/start.sh |
|
|
|
CMD ["/app/start.sh"] |
|
|