https://forms.gle/nRcDvXGMNdeEiVrv7
uv run fastapi dev main.py
curl
(why does this suck?)
https://www.docker.com/resources/what-container/
Dockerfiles
https://docs.docker.com/get-started/docker-concepts/building-images/understanding-image-layers
# FROM is used to pick a base image to start from # Alpine is a lightweight linux distro FROM alpine:3.22 # Install uv # COPY can be used to copy files from an existing image on the internet (from a "hub") COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ # Set work directory, this effectively sets the root path for any subsequent commands WORKDIR /app # COPY can also copy files from our local machine to the image COPY services/auth/. ./ # RUN is used to run a command directly on the image RUN uv sync --no-cache --link-mode=copy # CMD is used to set a command when running a container spawned from this image # This is not required and can be set at runtime CMD ["uv", "run", "fastapi", "dev", "main.py", "-p", "8000"]
localhost:8000
-p
# Map host port 8000 → container port 8000 docker run -p 8000:8000 my-image # Map to a different host port docker run -p 3000:8000 my-image
-p host_port:container_port
127.0.0.1
0.0.0.0
# This won't work for requests from outside the container fastapi dev main.py --host 127.0.0.1 # This will work fastapi dev main.py --host 0.0.0.0
# services/auth/app/config.py class Settings: database_url: str = "sqlite:///../../jarvis.db" jwt_secret_key: str = "super-secret-key-dont-use-this-in-production" jwt_algorithm: str = "HS256" access_token_expire_minutes: int = 30 refresh_token_expire_days: int = 30 cookie_secure: bool = True cookie_samesite: str = "None" settings = Settings()
Why does this suck?