Ricky01anjay commited on
Commit
c945b16
·
verified ·
1 Parent(s): c3373d2

Delete Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +0 -43
Dockerfile DELETED
@@ -1,43 +0,0 @@
1
- # Gunakan image node yang ringan
2
- FROM node:18-slim
3
-
4
- # Set working directory
5
- WORKDIR /app
6
-
7
- # Install library http-proxy secara langsung
8
- RUN npm install http-proxy
9
-
10
- # Buat file index.js langsung di dalam Dockerfile
11
- RUN echo 'const http = require("http"); \
12
- const httpProxy = require("http-proxy"); \
13
- const url = require("url"); \
14
- const proxy = httpProxy.createProxyServer({}); \
15
- \
16
- const server = http.createServer((req, res) => { \
17
- const query = url.parse(req.url, true).query; \
18
- const targetUrl = query.url; \
19
- \
20
- if (req.url.startsWith("/fetch") && targetUrl) { \
21
- console.log(`Proxying ${req.method} request to: ${targetUrl}`); \
22
- proxy.web(req, res, { \
23
- target: targetUrl, \
24
- changeOrigin: true, \
25
- ignorePath: true \
26
- }, (e) => { \
27
- res.writeHead(500); \
28
- res.end("Proxy Error: " + e.message); \
29
- }); \
30
- } else { \
31
- res.writeHead(200, { "Content-Type": "text/plain" }); \
32
- res.end("Gunakan /fetch?url=https://target-web.com"); \
33
- } \
34
- }); \
35
- \
36
- console.log("Server running on port 7860"); \
37
- server.listen(7860);' > index.js
38
-
39
- # Expose port standar Hugging Face Spaces
40
- EXPOSE 7860
41
-
42
- # Jalankan aplikasinya
43
- CMD ["node", "index.js"]