Update Dockerfile for correct directory structure
Browse files- Dockerfile +11 -11
Dockerfile
CHANGED
|
@@ -14,10 +14,10 @@ ENV NODE_OPTIONS="--max_old_space_size=3072" \
|
|
| 14 |
# ============================================
|
| 15 |
FROM base AS deps
|
| 16 |
|
| 17 |
-
WORKDIR /app
|
| 18 |
|
| 19 |
# Copy only package files for better caching
|
| 20 |
-
COPY package.json yarn.lock ./
|
| 21 |
|
| 22 |
# Use yarn with cache for faster installs
|
| 23 |
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
@@ -29,10 +29,10 @@ RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
| 29 |
# ============================================
|
| 30 |
FROM deps AS web-builder
|
| 31 |
|
| 32 |
-
WORKDIR /app
|
| 33 |
|
| 34 |
-
# Copy source files
|
| 35 |
-
COPY
|
| 36 |
|
| 37 |
# Install dev dependencies needed for build
|
| 38 |
RUN yarn add --dev autoprefixer postcss tailwindcss code-inspector-plugin
|
|
@@ -51,14 +51,14 @@ RUN apt-get update && \
|
|
| 51 |
build-essential \
|
| 52 |
&& rm -rf /var/lib/apt/lists/*
|
| 53 |
|
| 54 |
-
WORKDIR /app
|
| 55 |
|
| 56 |
# Use BuildKit's cache mount for pip
|
| 57 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 58 |
pip install --no-cache-dir poetry
|
| 59 |
|
| 60 |
# Copy and install Python dependencies
|
| 61 |
-
COPY pyproject.toml poetry.lock ./
|
| 62 |
RUN poetry config virtualenvs.create false && \
|
| 63 |
poetry install --no-dev --no-interaction --no-ansi
|
| 64 |
|
|
@@ -93,12 +93,12 @@ RUN --mount=type=cache,target=/root/.cache/pip \
|
|
| 93 |
|
| 94 |
# Copy built files from previous stages
|
| 95 |
COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
| 96 |
-
COPY --chown=user
|
| 97 |
|
| 98 |
# Copy Next.js standalone build
|
| 99 |
-
COPY --from=web-builder --chown=user /app/.next/standalone /app/web
|
| 100 |
-
COPY --from=web-builder --chown=user /app/.next/static /app/web/.next/static
|
| 101 |
-
COPY --from=web-builder --chown=user /app/public /app/web/public
|
| 102 |
|
| 103 |
# Set environment variables
|
| 104 |
ENV FLASK_APP=app.py \
|
|
|
|
| 14 |
# ============================================
|
| 15 |
FROM base AS deps
|
| 16 |
|
| 17 |
+
WORKDIR /app/web
|
| 18 |
|
| 19 |
# Copy only package files for better caching
|
| 20 |
+
COPY web/package.json web/yarn.lock ./
|
| 21 |
|
| 22 |
# Use yarn with cache for faster installs
|
| 23 |
RUN --mount=type=cache,target=/usr/local/share/.cache/yarn \
|
|
|
|
| 29 |
# ============================================
|
| 30 |
FROM deps AS web-builder
|
| 31 |
|
| 32 |
+
WORKDIR /app/web
|
| 33 |
|
| 34 |
+
# Copy web source files
|
| 35 |
+
COPY web/ .
|
| 36 |
|
| 37 |
# Install dev dependencies needed for build
|
| 38 |
RUN yarn add --dev autoprefixer postcss tailwindcss code-inspector-plugin
|
|
|
|
| 51 |
build-essential \
|
| 52 |
&& rm -rf /var/lib/apt/lists/*
|
| 53 |
|
| 54 |
+
WORKDIR /app/api
|
| 55 |
|
| 56 |
# Use BuildKit's cache mount for pip
|
| 57 |
RUN --mount=type=cache,target=/root/.cache/pip \
|
| 58 |
pip install --no-cache-dir poetry
|
| 59 |
|
| 60 |
# Copy and install Python dependencies
|
| 61 |
+
COPY api/pyproject.toml api/poetry.lock ./
|
| 62 |
RUN poetry config virtualenvs.create false && \
|
| 63 |
poetry install --no-dev --no-interaction --no-ansi
|
| 64 |
|
|
|
|
| 93 |
|
| 94 |
# Copy built files from previous stages
|
| 95 |
COPY --from=python-builder --chown=user /usr/local/lib/python3.10/site-packages /usr/local/lib/python3.10/site-packages
|
| 96 |
+
COPY --chown=user api/ /app/api/
|
| 97 |
|
| 98 |
# Copy Next.js standalone build
|
| 99 |
+
COPY --from=web-builder --chown=user /app/web/.next/standalone /app/web
|
| 100 |
+
COPY --from=web-builder --chown=user /app/web/.next/static /app/web/.next/static
|
| 101 |
+
COPY --from=web-builder --chown=user /app/web/public /app/web/public
|
| 102 |
|
| 103 |
# Set environment variables
|
| 104 |
ENV FLASK_APP=app.py \
|