You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
729 B
27 lines
729 B
ARG BASE_IMAGE=mcr.microsoft.com/vscode/devcontainers/python:3.11
|
|
FROM ${BASE_IMAGE}
|
|
|
|
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
PYTHONUNBUFFERED=1 \
|
|
PIP_NO_CACHE_DIR=1
|
|
|
|
WORKDIR /app
|
|
|
|
COPY requirements.txt ./requirements.txt
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
COPY app ./app
|
|
COPY sql ./sql
|
|
|
|
RUN useradd --create-home --uid 10001 appuser \
|
|
&& mkdir -p /app/data /app/uploads \
|
|
&& chown -R appuser:appuser /app
|
|
|
|
USER appuser
|
|
|
|
EXPOSE 8001
|
|
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \
|
|
CMD python -c "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8001/health', timeout=3)"
|
|
|
|
CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001"]
|
|
|