Georg commited on
Commit
8772f94
·
1 Parent(s): 3a6146c

Refactor Dockerfile to streamline build process and remove frontend build stage

Browse files

- Removed the multi-stage build for frontend assets, simplifying the Dockerfile.
- Consolidated application code copying to include the static frontend directory directly.
- Updated comments for clarity on the changes made to the build process.

Files changed (1) hide show
  1. Dockerfile +1 -22
Dockerfile CHANGED
@@ -1,21 +1,3 @@
1
- # Stage 1: Build frontend assets
2
- FROM node:20-slim AS frontend-builder
3
-
4
- WORKDIR /app/frontend
5
-
6
- # Copy frontend package files
7
- COPY frontend/package*.json ./
8
-
9
- # Install dependencies
10
- RUN npm ci
11
-
12
- # Copy frontend source
13
- COPY frontend/ ./
14
-
15
- # Build frontend
16
- RUN npm run build
17
-
18
- # Stage 2: Python runtime
19
  FROM python:3.11-slim-bookworm
20
 
21
  # Install system dependencies for MuJoCo and OpenCV
@@ -42,12 +24,9 @@ COPY requirements.txt .
42
  # Install Python dependencies
43
  RUN pip install --no-cache-dir -r requirements.txt
44
 
45
- # Copy application code
46
  COPY . .
47
 
48
- # Copy built frontend assets from builder stage
49
- COPY --from=frontend-builder /app/frontend/dist ./frontend/dist
50
-
51
  # Environment variables for headless rendering
52
  # Options: osmesa (software, slow), egl (GPU if available), glx (X11 GPU)
53
  ENV MUJOCO_GL=osmesa
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  FROM python:3.11-slim-bookworm
2
 
3
  # Install system dependencies for MuJoCo and OpenCV
 
24
  # Install Python dependencies
25
  RUN pip install --no-cache-dir -r requirements.txt
26
 
27
+ # Copy application code (including the static frontend directory)
28
  COPY . .
29
 
 
 
 
30
  # Environment variables for headless rendering
31
  # Options: osmesa (software, slow), egl (GPU if available), glx (X11 GPU)
32
  ENV MUJOCO_GL=osmesa