-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
36 changed files
with
1,107 additions
and
415 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ coverage.xml | |
.mypy_cache | ||
.pytest_cache | ||
.hypothesis | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
{ | ||
"semi": false, | ||
"singleQuote": false, | ||
"useTabs": false, | ||
"tabWidth": 2, | ||
"trailingComma": "none", | ||
"printWidth": 92, | ||
"proseWrap": "always", | ||
"arrowParens": "always", | ||
"embeddedLanguageFormatting": "off", | ||
"overrides": | ||
[ | ||
{ | ||
"files": "**/*.md", | ||
"options": | ||
{ | ||
"tabWidth": 4, | ||
"singleQuote": false, | ||
"trailingComma": "all", | ||
"arrowParens": "avoid", | ||
"printWidth": 92, | ||
"proseWrap": "always", | ||
"embeddedLanguageFormatting": "off" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
3.13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
# https://caddyserver.com/docs/caddyfile/concepts | ||
|
||
:{$PORT} { | ||
:5002 { | ||
reverse_proxy /* fnano:5001 | ||
encode zstd gzip | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Define Python version as an argument | ||
ARG PYTHON_VERSION=bleh | ||
|
||
# Install uv and dependencies | ||
FROM python:${PYTHON_VERSION}-slim AS builder | ||
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ | ||
|
||
# Set working directory | ||
WORKDIR /app | ||
|
||
# Install dependencies | ||
COPY pyproject.toml uv.lock /app/ | ||
RUN --mount=type=cache,target=/root/.cache/uv \ | ||
uv sync --frozen --no-install-project --no-editable --no-dev | ||
|
||
# Copy the project source code into the builder stage | ||
COPY . /app | ||
|
||
# Final stage with minimal footprint | ||
FROM python:${PYTHON_VERSION}-slim | ||
|
||
# Set the working directory in the final image | ||
WORKDIR /app | ||
|
||
# Copy the virtual environment and the source code from the builder stage | ||
COPY --from=builder /app/.venv /app/.venv | ||
COPY --from=builder /app /app | ||
|
||
# Set environment variables and add venv to PATH | ||
ENV PATH="/app/.venv/bin:$PATH" | ||
|
||
# Expose the application port | ||
EXPOSE 5001 | ||
|
||
# Entry point for running the application | ||
ENTRYPOINT ["gunicorn", "svc.main:app", "--workers", "2", "--worker-class", \ | ||
"uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:5001" ] |
Oops, something went wrong.