29 lines
782 B
Docker
29 lines
782 B
Docker
FROM python:3.12-slim-bookworm
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1
|
|
|
|
RUN groupadd --system app && useradd --system --gid app --create-home app
|
|
|
|
WORKDIR /app
|
|
|
|
COPY pyproject.toml uv.lock ./
|
|
RUN pip install --no-cache-dir uv \
|
|
&& uv export --format requirements-txt --no-dev --no-hashes --no-emit-project -o /tmp/requirements.txt \
|
|
&& pip install --no-cache-dir -r /tmp/requirements.txt
|
|
|
|
COPY . .
|
|
RUN pip install --no-cache-dir -e .
|
|
RUN python -m compileall -q mobilede_scraper
|
|
RUN chmod +x entrypoint.sh
|
|
RUN mkdir -p /data && chown -R app:app /app /data
|
|
|
|
STOPSIGNAL SIGINT
|
|
|
|
USER app
|
|
|
|
# По умолчанию запускаем API.
|
|
ENTRYPOINT ["./entrypoint.sh"]
|
|
CMD ["uvicorn", "mobilede_scraper.api.app:app", "--host", "0.0.0.0", "--port", "8000"]
|
|
|