FROM --platform=linux/amd64 python:3.8.10-slim AS backend
RUN mkdir -p /GreaterWMS/templates
ADD ./requirements.txt /GreaterWMS/requirements.txt
COPY ./backend_start.sh /GreaterWMS/backend_start.sh
WORKDIR /GreaterWMS
ENV port = ${port}
#Installation foundation dependency
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get clean
RUN apt-get update --fix-missing && apt-get upgrade -y
RUN apt-get install build-essential -y
RUN apt-get install supervisor nodejs npm -y
RUN pip3 config set global.index-url http://mirrors.aliyun.com/pypi/simple/
RUN pip3 config set install.trusted-host mirrors.aliyun.com
RUN python3 -m pip install --upgrade pip
#Install supervisor daphne
RUN pip3 install supervisor
RUN pip3 install -U 'Twisted[tls,http2]'
RUN pip3 install -r requirements.txt
RUN pip3 install daphne
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/
RUN npm install -g yarn --force
RUN yarn config set registry https://registry.npmmirror.com
RUN chmod +x /GreaterWMS/backend_start.sh
CMD ["/GreaterWMS/backend_start.sh"]
FROM --platform=linux/amd64 node:14.19.3-buster-slim AS front
COPY ./templates/package.json /GreaterWMS/templates/package.json
COPY ./web_start.sh /GreaterWMS/templates/web_start.sh
ENV port = ${port}
RUN sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list
RUN apt-get clean
RUN apt-get update --fix-missing && apt-get upgrade -y
RUN cd /GreaterWMS/templates
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/
RUN npm install -g yarn --force
RUN yarn config set registry https://registry.npmmirror.com
RUN npm config set registry https://mirrors.huaweicloud.com/repository/npm/ && npm install -g @quasar/cli --force
RUN yarn install
RUN chmod +x /GreaterWMS/templates/web_start.sh
ENTRYPOINT ["/GreaterWMS/templates/web_start.sh"] |