http-server proxy
SPA应用打包后的dist,前端单独部署单独启动,改写了http-server,把所有/api下的请求代理到另外的服务端,配合hash路由使用
/api/example -> http://localhost:$PORT/api/example
使用这个镜像的dockerfile可以这样写
FROM liujians/http-server
ENV MY_PATH = /var/www/
ENV PROXY = http://localhost:3000
WORKDIR $MY_PATH
COPY . .
RUN yarn install
RUN yarn build
EXPOSE 8000
CMD ["hsl", "./dist","-P","$PROXY","-p","8000"]
Content type
Image
Digest
Size
334.7 MB
Last updated
over 7 years ago
docker pull liujians/http-server