trinitytf commited on
Commit
44513ed
·
verified ·
1 Parent(s): 0fcc21b

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +32 -0
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM ghcr.io/flaresolverr/flaresolverr:latest
2
+
3
+ # 1. Set Hugging Face Port
4
+ ENV PORT=7860
5
+ ENV HOST=0.0.0.0
6
+
7
+ # 2. Critical: Set HOME to /tmp
8
+ # Chrome crashes if it can't write lockfiles to the user directory.
9
+ # /tmp is always writable in Docker.
10
+ ENV HOME=/tmp
11
+
12
+ # 3. Optimize for Hugging Face
13
+ # Disable the internal startup test to prevent timeouts (we know it works)
14
+ ENV TEST_URL=127.0.0.1
15
+ # Reduce logging noise unless there is an error
16
+ ENV LOG_LEVEL=info
17
+ # Force Chrome to use /tmp for its user data to avoid permission crashes
18
+ ENV CHROMIUM_ARGS="--user-data-dir=/tmp/chrome-data --no-sandbox --disable-dev-shm-usage"
19
+
20
+ # 4. Fix Permissions for User 1000 (Hugging Face Default)
21
+ USER root
22
+ RUN mkdir -p /tmp/chrome-data && \
23
+ chown -R 1000:1000 /tmp && \
24
+ chmod -R 777 /tmp && \
25
+ chown -R 1000:1000 /app && \
26
+ chmod -R 777 /app
27
+
28
+ # Switch back to the required Hugging Face user
29
+ USER 1000
30
+
31
+ # Expose the port
32
+ EXPOSE 7860