Dockerfile 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. FROM --platform=linux/amd64 python:3.8.10-slim AS backend
  2. RUN mkdir -p /GreaterWMS/templates
  3. #copy requirements.txt
  4. ADD ./requirements.txt /GreaterWMS/requirements.txt
  5. COPY ./backend_start.sh /GreaterWMS/backend_start.sh
  6. #Configure working directory
  7. WORKDIR /GreaterWMS
  8. ENV port = ${port}
  9. #Installation foundation dependency
  10. #RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
  11. #RUN apt-get clean
  12. RUN apt-get update --fix-missing && apt-get upgrade -y
  13. RUN apt-get install build-essential -y
  14. RUN apt-get install supervisor -y
  15. #Configure pip3 Alibaba Source
  16. #RUN pip3 config set global.index-url http://mirrors.aliyun.com/pypi/simple/
  17. #RUN pip3 config set install.trusted-host mirrors.aliyun.com
  18. RUN python3 -m pip install --upgrade pip
  19. #Install supervisor daphne
  20. RUN pip3 install supervisor
  21. RUN pip3 install -U 'Twisted[tls,http2]'
  22. RUN pip3 install -r requirements.txt
  23. RUN pip3 install daphne
  24. RUN chmod +x /GreaterWMS/backend_start.sh
  25. CMD ["/GreaterWMS/backend_start.sh"]
  26. FROM --platform=linux/amd64 node:14.19.3-buster-slim AS front
  27. COPY ./templates/package.json /GreaterWMS/templates/package.json
  28. #COPY ./templates/node_modules/ /GreaterWMS/templates/node_modules/
  29. COPY ./web_start.sh /GreaterWMS/templates/web_start.sh
  30. ENV port = ${port}
  31. #ENV NODE_OPTIONS=--openssl-legacy-provider
  32. RUN cd /GreaterWMS/templates
  33. RUN npm install -g npm --force
  34. #RUN npm config set registry https://registry.npm.taobao.org
  35. RUN npm install -g yarn --force
  36. #RUN yarn config set registry https://registry.npm.taobao.org
  37. RUN npm install -g @quasar/cli --force
  38. RUN yarn install
  39. RUN chmod +x /GreaterWMS/templates/web_start.sh
  40. ENTRYPOINT ["/GreaterWMS/templates/web_start.sh"]