You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
1.2 KiB
33 lines
1.2 KiB
FROM node:18.12.0-alpine3.16 AS web
|
|
|
|
WORKDIR /opt/vue-fastapi-admin
|
|
COPY /web ./web
|
|
RUN cd /opt/vue-fastapi-admin/web && npm i --registry=https://registry.npmmirror.com && npm run build
|
|
|
|
|
|
FROM python:3.11-slim-bullseye
|
|
|
|
WORKDIR /opt/vue-fastapi-admin
|
|
ADD . .
|
|
COPY /deploy/entrypoint.sh .
|
|
|
|
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked,id=core-apt \
|
|
--mount=type=cache,target=/var/lib/apt,sharing=locked,id=core-apt \
|
|
sed -i "s@http://.*.debian.org@http://mirrors.ustc.edu.cn@g" /etc/apt/sources.list \
|
|
&& rm -f /etc/apt/apt.conf.d/docker-clean \
|
|
&& ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime \
|
|
&& echo "Asia/Shanghai" > /etc/timezone \
|
|
&& apt-get update \
|
|
&& apt-get install -y --no-install-recommends gcc python3-dev bash nginx vim curl procps net-tools
|
|
|
|
RUN pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
|
|
|
|
COPY --from=web /opt/vue-fastapi-admin/web/dist /opt/vue-fastapi-admin/web/dist
|
|
ADD /deploy/web.conf /etc/nginx/sites-available/web.conf
|
|
RUN rm -f /etc/nginx/sites-enabled/default \
|
|
&& ln -s /etc/nginx/sites-available/web.conf /etc/nginx/sites-enabled/
|
|
|
|
ENV LANG=zh_CN.UTF-8
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT [ "sh", "entrypoint.sh" ] |