Severian commited on
Commit
9cb412e
·
1 Parent(s): 70af3c6

Update Dockerfile for correct directory structure

Browse files
Files changed (1) hide show
  1. 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 dependencies with memory optimizations
16
- RUN yarn config set network-timeout 300000 && \
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 with optimizations
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 with memory optimizations
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 installer.max-workers 4 && \
50
- poetry install --only main --no-interaction --no-ansi
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