Skip to content

Commit

Permalink
Optimal way to build docker image with app
Browse files Browse the repository at this point in the history
  • Loading branch information
cmin764 committed Dec 2, 2024
1 parent 28e57b0 commit feedf05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ WORKDIR /app
# Install uv deps with pip.
RUN pip install uv
COPY pyproject.toml .
RUN uv export --no-dev >requirements.txt && pip install -Ur requirements.txt
RUN uv pip install --system -Ur pyproject.toml

# Copy the rest of the application code.
# Copy the rest of the application code and install the project too.
COPY . .
RUN uv pip install --system -e .

# Run the FastAPI app using uvicorn on default port.
EXPOSE 80

# Command to run the FastAPI app using uvicorn.
CMD ["fastapi", "run", "deep_ice", "--port", "80"]
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ dev-dependencies = [
"types-passlib>=1.7.7.20240819",
]

[tool.setuptools]
packages = ["deep_ice"]

[tool.pytest.ini_options]
# Explicitly set the loop scope for asyncio fixtures to avoid the deprecation warning
asyncio_default_fixture_loop_scope = "function"
Expand Down

0 comments on commit feedf05

Please sign in to comment.