Update Dockerfile
Browse files- 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
|
| 12 |
RUN cargo build --release
|
| 13 |
|
| 14 |
-
#
|
| 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
|
| 57 |
COPY --from=builder /tmp/config.lua /app/websurfx/config.lua
|
| 58 |
|
| 59 |
-
#
|
| 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
|