| FROM debian |
| RUN mkdir -p /app |
| RUN apt-get update -y && apt-get install -y nodejs npm |
| RUN npm install express nodejs |
|
|
| COPY <<EOF /app/index.js |
| const express = require("express"); |
| const app = express(); |
| const { createProxyMiddleware } = require("http-proxy-middleware"); |
|
|
| app.use( |
| "/" + "*", |
| createProxyMiddleware({ |
| target: "http://127.0.0.1:8000/", |
| changeOrigin: false, |
| ws: true, |
| logLevel: "error", |
| onProxyReq: function onProxyReq(proxyReq, req, res) { } |
| }) |
| ); |
|
|
| app.listen(7860, () => console.log(`Example app listening on port ${port}!`)); |
| EOF |
|
|
| COPY anakin_proxy_linux_amd64 /app/anakin |
| RUN chmod -R u+rwx,g+rwx,o+rwx /app && chmod +x /app/anakin |
| WORKDIR /app |
| CMD /app/anakin & node /app/index.js |