Spaces:
Build error
Build error
Update Dockerfile for correct directory structure
Browse files- Dockerfile +7 -19
Dockerfile
CHANGED
@@ -15,17 +15,9 @@ FROM base AS web-builder
|
|
15 |
|
16 |
WORKDIR /app/web
|
17 |
|
18 |
-
# Setup build cache
|
19 |
-
RUN --mount=type=cache,target=/root/.yarn \
|
20 |
-
--mount=type=cache,target=/root/.npm \
|
21 |
-
yarn config set cache-folder /root/.yarn && \
|
22 |
-
npm config set cache /root/.npm
|
23 |
-
|
24 |
# Copy package files and install dependencies
|
25 |
COPY web/package.json web/yarn.lock ./
|
26 |
-
RUN
|
27 |
-
--mount=type=cache,target=/root/.npm \
|
28 |
-
yarn install --frozen-lockfile --network-timeout 300000 && \
|
29 |
yarn add code-inspector-plugin
|
30 |
|
31 |
# Copy source and build
|
@@ -35,9 +27,8 @@ RUN yarn build
|
|
35 |
# Python builder stage
|
36 |
FROM python:3.10-slim-bookworm AS python-builder
|
37 |
|
38 |
-
# Install build dependencies
|
39 |
-
RUN
|
40 |
-
apt-get update && \
|
41 |
apt-get install -y --no-install-recommends \
|
42 |
build-essential \
|
43 |
&& rm -rf /var/lib/apt/lists/*
|
@@ -45,21 +36,18 @@ RUN --mount=type=cache,target=/var/cache/apt \
|
|
45 |
WORKDIR /app/api
|
46 |
|
47 |
# Install and configure poetry
|
48 |
-
RUN --
|
49 |
-
pip install --no-cache-dir poetry
|
50 |
|
51 |
# Copy Python files and install dependencies
|
52 |
COPY api/pyproject.toml api/poetry.lock ./
|
53 |
-
RUN
|
54 |
-
poetry config virtualenvs.create false && \
|
55 |
poetry install --no-dev --no-interaction --no-ansi
|
56 |
|
57 |
# Final stage
|
58 |
FROM python:3.10-slim-bookworm
|
59 |
|
60 |
-
# Install runtime dependencies
|
61 |
-
RUN
|
62 |
-
apt-get update && \
|
63 |
apt-get install -y --no-install-recommends \
|
64 |
nodejs \
|
65 |
npm \
|
|
|
15 |
|
16 |
WORKDIR /app/web
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
# Copy package files and install dependencies
|
19 |
COPY web/package.json web/yarn.lock ./
|
20 |
+
RUN yarn install --frozen-lockfile --network-timeout 300000 && \
|
|
|
|
|
21 |
yarn add code-inspector-plugin
|
22 |
|
23 |
# Copy source and build
|
|
|
27 |
# Python builder stage
|
28 |
FROM python:3.10-slim-bookworm AS python-builder
|
29 |
|
30 |
+
# Install build dependencies in a single layer
|
31 |
+
RUN apt-get update && \
|
|
|
32 |
apt-get install -y --no-install-recommends \
|
33 |
build-essential \
|
34 |
&& rm -rf /var/lib/apt/lists/*
|
|
|
36 |
WORKDIR /app/api
|
37 |
|
38 |
# Install and configure poetry
|
39 |
+
RUN pip install --no-cache-dir poetry
|
|
|
40 |
|
41 |
# Copy Python files and install dependencies
|
42 |
COPY api/pyproject.toml api/poetry.lock ./
|
43 |
+
RUN poetry config virtualenvs.create false && \
|
|
|
44 |
poetry install --no-dev --no-interaction --no-ansi
|
45 |
|
46 |
# Final stage
|
47 |
FROM python:3.10-slim-bookworm
|
48 |
|
49 |
+
# Install runtime dependencies in a single layer
|
50 |
+
RUN apt-get update && \
|
|
|
51 |
apt-get install -y --no-install-recommends \
|
52 |
nodejs \
|
53 |
npm \
|