Skip to content

Commit ffee973

Browse files
committed
EX-319: docker build fix v5
1 parent e7e7abe commit ffee973

1 file changed

Lines changed: 15 additions & 10 deletions

File tree

Dockerfile

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,31 @@
11
# Dockerfile
22

3-
43
FROM python:3.11-slim as builder
54

6-
RUN pip install poetry
5+
ENV POETRY_HOME="/opt/poetry"
6+
RUN python3 -m venv $POETRY_HOME
7+
ENV PATH="$POETRY_HOME/bin:$PATH"
8+
RUN pip install --upgrade pip && pip install poetry
9+
10+
711
WORKDIR /app
8-
COPY pyproject.toml poetry.lock ./
912

10-
RUN poetry install --without dev --no-interaction --no-ansi
13+
COPY poetry.lock pyproject.toml ./
14+
15+
RUN poetry install --no-root --no-dev
1116

1217
FROM python:3.11-slim
1318

1419
WORKDIR /app
1520

16-
COPY --from=builder /root/.cache/pypoetry/virtualenvs/ /root/.cache/pypoetry/virtualenvs/
17-
18-
COPY --from=builder /app/pyproject.toml /app/
21+
COPY --from=builder /app/.venv /app/.venv
1922

2023
COPY src/ /app/src/
24+
COPY pyproject.toml .
25+
26+
ENV PATH="/app/.venv/bin:$PATH"
2127

22-
RUN poetry config virtualenvs.in-project false --local \
23-
&& poetry config virtualenvs.path /root/.cache/pypoetry/virtualenvs
28+
RUN pip install .
2429

25-
ENTRYPOINT ["poetry", "run", "code-review-agent"]
30+
ENTRYPOINT ["code-review-agent"]
2631
CMD ["--help"]

0 commit comments

Comments
 (0)