Skip to content

Commit

Permalink
chore: make some minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
pplmx committed Aug 17, 2024
1 parent 0bfeb9d commit 82e2ebc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions template/py/{{cookiecutter.project_slug}}/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ FROM python:{{cookiecutter.python_version}}-bullseye AS builder
ENV PATH="/root/.cargo/bin:$PATH" \
PIP_INDEX_URL="https://mirrors.cernet.edu.cn/pypi/web/simple"

# Install uv and tools
RUN curl -LsSf https://astral.sh/uv/install.sh | sh && \
uv tool install hatch && \
uv tool install ruff
Expand All @@ -12,6 +13,7 @@ WORKDIR /app

COPY pyproject.toml .

# Create and install dependencies in the virtual environment
RUN uv venv venv && \
. venv/bin/activate && \
uv pip install .[dev]
Expand All @@ -27,10 +29,12 @@ ENV PATH="/app/venv/bin:/root/.local/bin:$PATH" \

WORKDIR /app

# Copy the virtual environment and application code
COPY --from=builder /app/venv /app/venv
COPY --from=builder /root/.local /root/.local
COPY . .

# Ensure the application builds and tests are executed correctly
RUN hatch build && hatch test

CMD ["python", "src/app.py"]

0 comments on commit 82e2ebc

Please sign in to comment.