Fix dockerfile to host API, also TypeIgnored pydantic_settings since it doesn't want to recognize it

This commit is contained in:
2024-12-30 20:56:09 +02:00
parent b4fb6d6f52
commit 96f7656183
2 changed files with 11 additions and 9 deletions
+10 -8
View File
@@ -1,17 +1,19 @@
# Sets up the API before preventing root access to the alpine image
FROM python:3.13-alpine
WORKDIR /app
WORKDIR /src
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
COPY ./src/ /src/
RUN apk upgrade --no-cache &&\
uv pip install --system -r /src/requirements/requirements.txt
RUN adduser -D nonroot
USER nonroot
COPY ./src/ /app/
RUN pip install --upgrade pip &&\
pip install uv &&\
uv pip install --user --no-cache-dir --upgrade -r /code/requirements/requirements.txt
EXPOSE 8000
ENTRYPOINT ["python", "-m"]
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
CMD ["fastapi", "run"]
+1 -1
View File
@@ -1,5 +1,5 @@
from pydantic_settings import BaseSettings, SettingsConfigDict
from pydantic_settings import BaseSettings, SettingsConfigDict # type: ignore
import pytz
class Settings(BaseSettings):