| FROM node:18-alpine |
|
|
| ENV USER ${USER:-node} |
| ENV USER_ID ${USER_ID:-1000} |
|
|
| WORKDIR /app |
|
|
| COPY . /app |
| RUN apk add curl wget supervisor git py3-flask |
| RUN git clone https://github.com/Harry-zklcdc/BingAPI-Demo.git && \ |
| cd BingAPI-Demo && \ |
| npm install && \ |
| npm run build |
|
|
|
|
| RUN curl -L https://github.com/cloudflare/cloudflared/releases/latest/download/cloudflared-linux-amd64 -o cloudflared && \ |
| chmod +x cloudflared |
|
|
| RUN curl -L https://github.com/Harry-zklcdc/go-proxy-bingai/releases/latest/download/go-proxy-bingai-linux-amd64.tar.gz -o go-proxy-bingai-linux-amd64.tar.gz && \ |
| tar -xvf go-proxy-bingai-linux-amd64.tar.gz && \ |
| chmod +x go-proxy-bingai && \ |
| rm go-proxy-bingai-linux-amd64.tar.gz |
|
|
| RUN mkdir -p /var/run/supervisor /var/log/supervisor |
| RUN chown "${USER_ID}:${USER_ID}" /var/run/supervisor /var/log/supervisor |
| RUN chmod 777 /tmp |
|
|
| USER $USER |
|
|
| EXPOSE 5000 |
|
|
| CMD /usr/bin/supervisord -c supervisor.conf |