Dockerfile 1.1 KB

123456789101112131415161718192021222324252627282930313233
  1. # Use a Python image with uv pre-installed
  2. FROM ghcr.io/astral-sh/uv:python3.13-trixie-slim
  3. # Install the project into `/app`
  4. WORKDIR /app
  5. # Enable bytecode compilation
  6. ENV UV_COMPILE_BYTECODE=1
  7. # Copy from the cache instead of linking since it's a mounted volume
  8. ENV UV_LINK_MODE=copy
  9. # Ensure installed tools can be executed out of the box
  10. ENV UV_TOOL_BIN_DIR=/usr/local/bin
  11. COPY apps/hip-3-pusher/uv.lock .
  12. COPY apps/hip-3-pusher/pyproject.toml .
  13. # Install the project's dependencies using the lockfile and settings
  14. RUN --mount=type=cache,target=/root/.cache/uv \
  15. --mount=type=bind,source=apps/hip-3-pusher/uv.lock,target=uv.lock \
  16. --mount=type=bind,source=apps/hip-3-pusher/pyproject.toml,target=pyproject.toml \
  17. uv sync --locked --no-install-project --no-dev
  18. # Then, add the rest of the project source code and install it
  19. # Installing separately from its dependencies allows optimal layer caching
  20. COPY apps/hip-3-pusher/src/ ./src/
  21. COPY apps/hip-3-pusher/config/ ./config/
  22. RUN --mount=type=cache,target=/root/.cache/uv \
  23. uv sync --locked --no-dev
  24. # Run the app by default
  25. CMD ["uv", "run", "-m", "pusher.main", "--config", "config/config.toml"]