postcat/Dockerfile

35 lines
794 B
Docker
Raw Normal View History

2022-11-01 21:41:26 +08:00
FROM node:lts-alpine as builder
WORKDIR /test-server
# api 测试服务端口
ENV NODE_SERVER_PORT 4201
# websocket 测试服务端口
ENV EOAPI_WEBSOCKET_PORT 4202
2022-11-01 21:41:26 +08:00
COPY /src/workbench/node /test-server
2022-11-18 11:20:41 +08:00
RUN npm config set registry https://registry.npmmirror.com
RUN yarn config set registry https://registry.npmmirror.com
2022-11-01 21:41:26 +08:00
RUN yarn install
EXPOSE $NODE_SERVER_PORT $EOAPI_WEBSOCKET_PORT
2022-11-01 21:41:26 +08:00
CMD ["yarn", "start:all"]
FROM nginx:alpine as production
ENV NODE_ENV production
2022-11-21 14:07:13 +08:00
# 远程服务端口
ENV EOAPI_SERVER_PORT 3000
# api 测试服务端口
ENV NODE_SERVER_PORT 4201
# websocket 测试服务端口
ENV EOAPI_WEBSOCKET_PORT 4202
2022-11-01 21:41:26 +08:00
COPY ./src/workbench/browser/dist/ /usr/share/nginx/html
2022-11-21 14:07:13 +08:00
COPY ./default.conf.template /etc/nginx/templates/
2022-11-01 21:41:26 +08:00
EXPOSE $NODE_SERVER_PORT $EOAPI_WEBSOCKET_PORT