THEAIMART commited on
Commit
af1707f
·
verified ·
1 Parent(s): 8aeebf1

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -29
Dockerfile CHANGED
@@ -8,34 +8,11 @@ RUN apt-get update && apt-get install -y git pkg-config libssl-dev cmake
8
  # AAPKI GitHub Repo ko clone karna
9
  RUN git clone https://github.com/SATPAL-18/websurfx.git .
10
 
11
- # Aapke code ko compile karna (Cache use hoga, toh jaldi ho jayega)
12
  RUN cargo build --release
13
 
14
- # SMART SCRIPT IN BUILDER: Yahan code mojud hai, toh hum yahi config dhoond lenge
15
- RUN find . -type f -name "config.lua" -exec cp {} /tmp/config.lua \; -quit && \
16
- if [ ! -f /tmp/config.lua ]; then \
17
- echo 'port = 7860\n\
18
- bind_address = "0.0.0.0"\n\
19
- threads = 2\n\
20
- logging = true\n\
21
- timeout = 15\n\
22
- \n\
23
- style = {\n\
24
- theme = "simple",\n\
25
- colorscheme = "catppuccin-mocha"\n\
26
- }\n\
27
- \n\
28
- search = {\n\
29
- safe_search = 0\n\
30
- }\n\
31
- \n\
32
- engines = {\n\
33
- google = 1,\n\
34
- duckduckgo = 1,\n\
35
- bing = 1\n\
36
- }' > /tmp/config.lua; \
37
- fi
38
-
39
 
40
  # STEP 2: Compiled app ko Hugging Face par chalana
41
  FROM debian:bookworm-slim
@@ -53,11 +30,12 @@ COPY --from=builder /usr/src/app/public /app/public
53
  # Config folders banana
54
  RUN mkdir -p /app/websurfx /app/colorschemes
55
 
56
- # Builder se safely config copy karna (Ab koi error nahi aayega)
57
  COPY --from=builder /tmp/config.lua /app/websurfx/config.lua
58
 
59
- # Hugging Face ke liye port hamesha 7860 set karna
60
- RUN sed -i 's/port = .*/port = 7860/' /app/websurfx/config.lua
 
61
 
62
  # Permissions theek karna
63
  RUN chmod -R 777 /app /app/websurfx
 
8
  # AAPKI GitHub Repo ko clone karna
9
  RUN git clone https://github.com/SATPAL-18/websurfx.git .
10
 
11
+ # Aapke code ko compile karna
12
  RUN cargo build --release
13
 
14
+ # Original config dhoond kar copy karna
15
+ RUN find . -type f -name "config.lua" -exec cp {} /tmp/config.lua \; -quit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
 
17
  # STEP 2: Compiled app ko Hugging Face par chalana
18
  FROM debian:bookworm-slim
 
30
  # Config folders banana
31
  RUN mkdir -p /app/websurfx /app/colorschemes
32
 
33
+ # Builder se safely config copy karna
34
  COPY --from=builder /tmp/config.lua /app/websurfx/config.lua
35
 
36
+ # YAHAN HAI MAGIC FIX: Direct 127.0.0.1 ko 0.0.0.0 se brute-force replace karna
37
+ RUN sed -i 's/port = .*/port = "7860"/' /app/websurfx/config.lua && \
38
+ sed -i 's/127.0.0.1/0.0.0.0/g' /app/websurfx/config.lua
39
 
40
  # Permissions theek karna
41
  RUN chmod -R 777 /app /app/websurfx