Skip to content

Commit 1da2314

Browse files
authored
fix run issues for docker (#8)
1 parent b9250ca commit 1da2314

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,32 @@ RUN uv sync --frozen --no-dev
2323
# Copy the application code
2424
COPY void_hdt/ ./void_hdt/
2525

26+
# Install the project itself into the venv
27+
RUN uv sync --frozen --no-dev
28+
2629
# Runtime stage: slim image with only runtime dependencies
2730
FROM python:3.12-slim
2831

2932
# Set working directory
3033
WORKDIR /app
3134

32-
# Install uv in runtime image
33-
COPY --from=ghcr.io/astral-sh/uv:latest /uv /usr/local/bin/uv
35+
# Install runtime C++ libraries (needed to run the compiled rdflib-hdt)
36+
RUN apt-get update && apt-get install -y --no-install-recommends \
37+
libstdc++6 \
38+
&& rm -rf /var/lib/apt/lists/*
3439

35-
# Copy the virtual environment from builder
40+
# Copy the virtual environment
3641
COPY --from=builder /app/.venv /app/.venv
37-
38-
# Copy the application code
3942
COPY --from=builder /app/void_hdt /app/void_hdt
4043

41-
# Copy project files needed by uv
42-
COPY pyproject.toml uv.lock ./
44+
# Place the venv binaries on the PATH
45+
ENV PATH="/app/.venv/bin:$PATH"
46+
47+
# Ensure Python can find the module in /app
48+
ENV PYTHONPATH="/app"
4349

4450
# Set the entrypoint to use uv run (handles environment automatically)
45-
ENTRYPOINT ["uv", "run", "void-hdt"]
51+
ENTRYPOINT ["void-hdt"]
4652

4753
# Default help command if no args provided
4854
CMD ["--help"]

0 commit comments

Comments
 (0)