Update Dockerfile for correct directory structure
Browse files- Dockerfile +7 -13
Dockerfile
CHANGED
@@ -7,20 +7,18 @@ WORKDIR /app/web
|
|
7 |
# Copy package files first
|
8 |
COPY web/package.json web/yarn.lock ./
|
9 |
|
10 |
-
# Configure Node to use less memory
|
11 |
ENV NODE_OPTIONS="--max_old_space_size=2048"
|
12 |
ENV NEXT_TELEMETRY_DISABLED=1
|
13 |
ENV NODE_ENV=production
|
14 |
|
15 |
-
# Install
|
16 |
-
RUN yarn
|
17 |
-
yarn install --frozen-lockfile --network-timeout 300000 && \
|
18 |
-
yarn cache clean
|
19 |
|
20 |
# Copy web source files
|
21 |
COPY web/ .
|
22 |
|
23 |
-
# Build web app
|
24 |
RUN yarn build
|
25 |
|
26 |
# Python base image for final stage
|
@@ -39,15 +37,11 @@ WORKDIR /app
|
|
39 |
# Copy API files
|
40 |
COPY api/ /app/api/
|
41 |
|
42 |
-
# Install Python dependencies
|
43 |
WORKDIR /app/api
|
44 |
-
ENV POETRY_VIRTUALENVS_CREATE=false
|
45 |
-
ENV POETRY_NO_INTERACTION=1
|
46 |
-
|
47 |
-
# Install dependencies in chunks to avoid memory issues
|
48 |
RUN pip install --no-cache-dir poetry && \
|
49 |
-
poetry config
|
50 |
-
poetry install --
|
51 |
|
52 |
# Copy built web files from builder stage
|
53 |
COPY --from=web-builder /app/web/.next /app/web/.next
|
|
|
7 |
# Copy package files first
|
8 |
COPY web/package.json web/yarn.lock ./
|
9 |
|
10 |
+
# Configure Node to use less memory and disable telemetry
|
11 |
ENV NODE_OPTIONS="--max_old_space_size=2048"
|
12 |
ENV NEXT_TELEMETRY_DISABLED=1
|
13 |
ENV NODE_ENV=production
|
14 |
|
15 |
+
# Install only production dependencies
|
16 |
+
RUN yarn install --production --frozen-lockfile --network-timeout 300000
|
|
|
|
|
17 |
|
18 |
# Copy web source files
|
19 |
COPY web/ .
|
20 |
|
21 |
+
# Build web app
|
22 |
RUN yarn build
|
23 |
|
24 |
# Python base image for final stage
|
|
|
37 |
# Copy API files
|
38 |
COPY api/ /app/api/
|
39 |
|
40 |
+
# Install Python dependencies
|
41 |
WORKDIR /app/api
|
|
|
|
|
|
|
|
|
42 |
RUN pip install --no-cache-dir poetry && \
|
43 |
+
poetry config virtualenvs.create false && \
|
44 |
+
poetry install --no-dev
|
45 |
|
46 |
# Copy built web files from builder stage
|
47 |
COPY --from=web-builder /app/web/.next /app/web/.next
|