Spaces:
Build error
Build error
Update Dockerfile for correct directory structure
Browse files- Dockerfile +6 -4
Dockerfile
CHANGED
@@ -3,10 +3,12 @@ FROM node:20.11-alpine3.19 AS web-builder
|
|
3 |
|
4 |
# Set working directory for web
|
5 |
WORKDIR /app/web
|
6 |
-
COPY web/package*.json ./
|
7 |
|
8 |
-
#
|
9 |
-
|
|
|
|
|
|
|
10 |
|
11 |
# Copy web source files
|
12 |
COPY web/ .
|
@@ -14,7 +16,7 @@ COPY web/ .
|
|
14 |
# Build web app with optimizations
|
15 |
ENV NODE_ENV=production
|
16 |
ENV NEXT_TELEMETRY_DISABLED=1
|
17 |
-
RUN
|
18 |
|
19 |
# Python base image for final stage
|
20 |
FROM python:3.10-slim-bookworm
|
|
|
3 |
|
4 |
# Set working directory for web
|
5 |
WORKDIR /app/web
|
|
|
6 |
|
7 |
+
# Copy package files first
|
8 |
+
COPY web/package.json web/yarn.lock ./
|
9 |
+
|
10 |
+
# Install dependencies using yarn (more reliable than npm for this project)
|
11 |
+
RUN yarn install --frozen-lockfile --production=true
|
12 |
|
13 |
# Copy web source files
|
14 |
COPY web/ .
|
|
|
16 |
# Build web app with optimizations
|
17 |
ENV NODE_ENV=production
|
18 |
ENV NEXT_TELEMETRY_DISABLED=1
|
19 |
+
RUN yarn build
|
20 |
|
21 |
# Python base image for final stage
|
22 |
FROM python:3.10-slim-bookworm
|