Rishabh2095 commited on
Commit
ea10140
·
1 Parent(s): f57fe35

Modified Dockerfile to ensure Playwright is installed within the correct directory

Browse files
Files changed (1) hide show
  1. Dockerfile +15 -3
Dockerfile CHANGED
@@ -34,9 +34,19 @@ RUN --mount=type=cache,target=/root/.cache/uv \
34
  # Install Playwright system dependencies (after playwright package is installed)
35
  RUN playwright install-deps chromium
36
 
37
- # Install Playwright browser binaries (with cache mount)
 
 
 
 
 
 
 
38
  RUN --mount=type=cache,target=/root/.cache/ms-playwright \
39
- playwright install chromium
 
 
 
40
 
41
  # Create API directories and install langgraph-api as ROOT
42
  RUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && \
@@ -71,7 +81,9 @@ ENV HOME=/home/hf_user \
71
  # Package-specific cache directories (for packages that don't fully respect XDG)
72
  TIKTOKEN_CACHE_DIR=/home/hf_user/.cache/tiktoken \
73
  HF_HOME=/home/hf_user/.cache/huggingface \
74
- TORCH_HOME=/home/hf_user/.cache/torch
 
 
75
 
76
  WORKDIR /deps/job_writer
77
 
 
34
  # Install Playwright system dependencies (after playwright package is installed)
35
  RUN playwright install-deps chromium
36
 
37
+ # Create user's cache directory for Playwright browsers (BEFORE installing browsers)
38
+ # This ensures browsers are installed to the correct location that persists in the image
39
+ RUN mkdir -p /home/hf_user/.cache/ms-playwright && \
40
+ chown -R hf_user:hf_user /home/hf_user/.cache
41
+
42
+ # Install Playwright browser binaries to user's home directory
43
+ # Set PLAYWRIGHT_BROWSERS_PATH to ensure browsers are installed to the right location
44
+ # Use cache mount ONLY for the download cache, but install to persistent location
45
  RUN --mount=type=cache,target=/root/.cache/ms-playwright \
46
+ PLAYWRIGHT_BROWSERS_PATH=/home/hf_user/.cache/ms-playwright \
47
+ playwright install chromium && \
48
+ # Fix ownership after installation (browsers are installed as root)
49
+ chown -R hf_user:hf_user /home/hf_user/.cache/ms-playwright
50
 
51
  # Create API directories and install langgraph-api as ROOT
52
  RUN mkdir -p /api/langgraph_api /api/langgraph_runtime /api/langgraph_license && \
 
81
  # Package-specific cache directories (for packages that don't fully respect XDG)
82
  TIKTOKEN_CACHE_DIR=/home/hf_user/.cache/tiktoken \
83
  HF_HOME=/home/hf_user/.cache/huggingface \
84
+ TORCH_HOME=/home/hf_user/.cache/torch \
85
+ # Playwright browsers path (so it knows where to find browsers at runtime)
86
+ PLAYWRIGHT_BROWSERS_PATH=/home/hf_user/.cache/ms-playwright
87
 
88
  WORKDIR /deps/job_writer
89