mirror of
https://github.com/kennethreitz/kjvstudy.org.git
synced 2026-06-05 23:00:16 +00:00
Update Docker container to use FastAPI CLI directly
Remove package installation step and use FastAPI CLI with PYTHONPATH for simpler container execution. Disable reload in main.py and include static/templates as package data for proper distribution.
This commit is contained in:
+3
-4
@@ -23,6 +23,7 @@ COPY --from=ghcr.io/astral-sh/uv:latest /uv /bin/uv
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONPATH="/app" \
|
||||
PATH="/app/.venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
@@ -33,7 +34,5 @@ COPY --from=builder /app/.venv /app/.venv
|
||||
# Copy application code
|
||||
COPY . .
|
||||
|
||||
# Install the project itself
|
||||
RUN uv pip install --no-deps .
|
||||
|
||||
CMD ["kjvstudy-org"]
|
||||
# Run the application using FastAPI CLI
|
||||
CMD ["fastapi", "run", "kjvstudy_org.server:app", "--host", "0.0.0.0", "--port", "8000"]
|
||||
@@ -8,7 +8,7 @@ def main():
|
||||
"kjvstudy_org.server:app",
|
||||
host="0.0.0.0",
|
||||
port=8000,
|
||||
reload=True,
|
||||
reload=False,
|
||||
log_level="info"
|
||||
)
|
||||
|
||||
|
||||
+3
-1
@@ -23,7 +23,9 @@ build-backend = "setuptools.build_meta"
|
||||
[tool.setuptools.packages.find]
|
||||
where = ["."]
|
||||
include = ["kjvstudy_org*"]
|
||||
exclude = ["static", "templates"]
|
||||
|
||||
[tool.setuptools.package-data]
|
||||
kjvstudy_org = ["static/*", "templates/*"]
|
||||
|
||||
[tool.uv]
|
||||
package = true
|
||||
|
||||
Reference in New Issue
Block a user