add Docker

This commit is contained in:
Waylon S. Walker 2024-10-24 09:36:10 -05:00
parent feb21a4292
commit 986b8ba632
2 changed files with 56 additions and 1 deletions

30
Dockerfile Normal file
View file

@ -0,0 +1,30 @@
from python:3.13
WORKDIR /app
COPY src src
COPY pyproject.toml .
COPY uv.lock .
COPY README.md .
COPY requirements.txt .
ENV VIRTUAL_ENV=/app/.venv
ENV PATH=${VIRTUAL_ENV}/bin:${PATH}
RUN useradd -m appuser && chown -R appuser:appuser /app
USER appuser
ENV HOME=/home/appuser
ENV PATH=${HOME}/.local/bin:${PATH}
RUN pip install --upgrade pip && \
pip install uv && \
uv venv
RUN uv pip install -r requirements.txt
RUN uv pip install .
COPY static static
COPY templates templates
EXPOSE 8000
ENTRYPOINT ["uvicorn"]
CMD ["src.fastapi_dynamic_response.main:app", "--host", "0.0.0.0", "--port", "8000"]