Update Dockerfile for correct directory structure
Browse files- Dockerfile +15 -6
Dockerfile
CHANGED
|
@@ -15,17 +15,26 @@ FROM base AS web-builder
|
|
| 15 |
|
| 16 |
WORKDIR /app/web
|
| 17 |
|
| 18 |
-
# Copy package files
|
| 19 |
COPY web/package.json web/yarn.lock ./
|
| 20 |
|
| 21 |
-
# Install
|
|
|
|
|
|
|
|
|
|
| 22 |
RUN yarn install --frozen-lockfile --network-timeout 300000 && \
|
| 23 |
-
yarn add code-inspector-plugin autoprefixer postcss tailwindcss
|
| 24 |
-
yarn add --dev @types/node @types/react
|
| 25 |
|
| 26 |
-
# Copy source
|
| 27 |
COPY web/ .
|
| 28 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 29 |
|
| 30 |
# Python builder stage
|
| 31 |
FROM python:3.10-slim-bookworm AS python-builder
|
|
|
|
| 15 |
|
| 16 |
WORKDIR /app/web
|
| 17 |
|
| 18 |
+
# Copy package files first
|
| 19 |
COPY web/package.json web/yarn.lock ./
|
| 20 |
|
| 21 |
+
# Install build dependencies globally first
|
| 22 |
+
RUN npm install -g code-inspector-plugin autoprefixer postcss tailwindcss
|
| 23 |
+
|
| 24 |
+
# Install project dependencies
|
| 25 |
RUN yarn install --frozen-lockfile --network-timeout 300000 && \
|
| 26 |
+
yarn add --dev @types/node @types/react code-inspector-plugin autoprefixer postcss tailwindcss
|
|
|
|
| 27 |
|
| 28 |
+
# Copy source files
|
| 29 |
COPY web/ .
|
| 30 |
+
|
| 31 |
+
# Create a minimal next.config.js if needed
|
| 32 |
+
RUN if [ ! -f next.config.js ]; then \
|
| 33 |
+
echo "module.exports = { reactStrictMode: true };" > next.config.js; \
|
| 34 |
+
fi
|
| 35 |
+
|
| 36 |
+
# Build the application
|
| 37 |
+
RUN NODE_PATH=/usr/local/lib/node_modules yarn build
|
| 38 |
|
| 39 |
# Python builder stage
|
| 40 |
FROM python:3.10-slim-bookworm AS python-builder
|