fixed missing prisma binaries

This commit is contained in:
SwiftyOS
2024-09-12 12:02:00 +02:00
parent 2c940b381a
commit bd70ab00e0
2 changed files with 16 additions and 12 deletions

View File

@@ -28,7 +28,8 @@ RUN poetry config virtualenvs.create false \
# Generate Prisma client
COPY rnd/autogpt_server/schema.prisma ./
RUN poetry run prisma generate
RUN poetry config virtualenvs.create false \
&& poetry run prisma generate
FROM python:3.11-slim-buster AS server_dependencies
@@ -44,6 +45,9 @@ ENV POETRY_VERSION=1.8.3 \
COPY --from=builder /app /app
COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy Prisma binaries
COPY --from=builder /root/.cache/prisma-python/binaries /root/.cache/prisma-python/binaries
ENV PATH="/app/.venv/bin:$PATH"
@@ -59,7 +63,8 @@ WORKDIR /app/rnd/autogpt_server
FROM server_dependencies AS server_prisma
COPY rnd/autogpt_server/schema.prisma ./
RUN poetry run prisma generate
RUN poetry config virtualenvs.create false \
&& poetry run prisma generate
FROM server_dependencies AS server

View File

@@ -23,26 +23,24 @@ RUN pip3 install poetry
COPY rnd/autogpt_libs /app/rnd/autogpt_libs
COPY rnd/market/poetry.lock rnd/market/pyproject.toml /app/rnd/market/
WORKDIR /app/rnd/market
RUN poetry install --no-interaction --no-ansi
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi
# Generate Prisma client
COPY rnd/market /app/rnd/market
RUN poetry run prisma generate
RUN poetry config virtualenvs.create false \
&& poetry run prisma generate
FROM python:3.11-slim-buster AS server_dependencies
ENV POETRY_VERSION=1.8.3 \
POETRY_HOME="/opt/poetry" \
POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_CREATE=false \
PATH="$POETRY_HOME/bin:$PATH"
WORKDIR /app
# Copy only necessary files from builder
COPY --from=builder /app /app
COPY --from=builder /usr/local/lib/python3.11 /usr/local/lib/python3.11
COPY --from=builder /usr/local/bin /usr/local/bin
# Copy Prisma binaries
COPY --from=builder /root/.cache/prisma-python/binaries /root/.cache/prisma-python/binaries
ENV PATH="/app/.venv/bin:$PATH"
@@ -58,11 +56,12 @@ WORKDIR /app/rnd/market
FROM server_dependencies AS server_prisma
COPY rnd/market /app/rnd/market
RUN poetry run prisma generate
RUN poetry config virtualenvs.create false \
&& poetry run prisma generate
FROM server_prisma AS server
ENV DATABASE_URL=""
ENV PORT=8000
CMD ["uvicorn", "market.app:app"]
CMD ["uvicorn", "market.app:app", "--reload"]