trinitytf commited on
Commit
264a3ab
·
verified ·
1 Parent(s): 1cb6a97

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +36 -0
Dockerfile ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use the official image as base
2
+ FROM ghcr.io/flaresolverr/flaresolverr:latest
3
+
4
+ # 1. Set the Port to 7860 (Required by Hugging Face)
5
+ ENV PORT=7860
6
+ # 2. Host must be 0.0.0.0 to be accessible outside the container
7
+ ENV HOST=0.0.0.0
8
+ # 3. Disable the "Test" URL to prevent boot crashes if it fails
9
+ ENV TEST_URL=http://localhost:7860
10
+
11
+ # --- PERMISSION FIX ---
12
+ # Hugging Face runs as User 1000. We must ensure that user
13
+ # has permissions to write to the app directory and the home folder.
14
+ USER root
15
+
16
+ # Create the standard Hugging Face user home directory
17
+ RUN mkdir -p /home/user/app
18
+
19
+ # Copy the current application files to the new home (if any) and fix permissions
20
+ # We make the entire /app directory writable by User 1000
21
+ RUN chown -R 1000:1000 /app && \
22
+ chmod -R 777 /app && \
23
+ chown -R 1000:1000 /home/user && \
24
+ chmod -R 777 /home/user
25
+
26
+ # Set the Home directory explicitly
27
+ ENV HOME=/home/user
28
+
29
+ # Switch to User 1000 (The Hugging Face default)
30
+ USER 1000
31
+
32
+ # Expose the port
33
+ EXPOSE 7860
34
+
35
+ # The base image already has the correct command to start,
36
+ # so we don't need to overwrite CMD.