2022-02-04 08:29:58 +08:00
|
|
|
FROM python:3.8
|
2021-12-14 14:02:19 +08:00
|
|
|
|
2022-02-09 03:32:52 +08:00
|
|
|
RUN apt-get update --fix-missing
|
|
|
|
RUN apt-get --assume-yes install npm nginx libcairo2-dev pkg-config python3-dev
|
2021-12-17 04:50:04 +08:00
|
|
|
RUN pip install pandas matplotlib
|
2021-12-14 14:02:19 +08:00
|
|
|
RUN mkdir gradio
|
|
|
|
WORKDIR /gradio
|
2021-12-17 04:50:04 +08:00
|
|
|
COPY ./frontend ./frontend
|
2022-02-04 08:29:58 +08:00
|
|
|
RUN mkdir gradio
|
|
|
|
COPY ./gradio/version.txt ./gradio/version.txt
|
2021-12-14 14:02:19 +08:00
|
|
|
WORKDIR /gradio/frontend
|
|
|
|
RUN npm install
|
|
|
|
RUN npm run build
|
|
|
|
WORKDIR /gradio
|
2021-12-17 04:50:04 +08:00
|
|
|
COPY ./gradio ./gradio
|
|
|
|
COPY ./setup.py ./setup.py
|
|
|
|
COPY ./MANIFEST.in ./MANIFEST.in
|
2021-12-14 14:02:19 +08:00
|
|
|
RUN python setup.py install
|
2021-12-17 04:50:04 +08:00
|
|
|
WORKDIR /gradio
|
|
|
|
COPY ./website ./website
|
2021-12-14 14:02:19 +08:00
|
|
|
WORKDIR /gradio/website/homepage
|
|
|
|
RUN pip install -r requirements.txt
|
2021-12-17 04:50:04 +08:00
|
|
|
WORKDIR /gradio
|
|
|
|
COPY ./guides ./guides
|
|
|
|
COPY ./demo ./demo
|
|
|
|
WORKDIR /gradio/website/homepage
|
|
|
|
ARG COLAB_NOTEBOOK_LINKS
|
2021-12-14 14:02:19 +08:00
|
|
|
RUN echo $COLAB_NOTEBOOK_LINKS > generated/colab_links.json
|
|
|
|
RUN npm install
|
|
|
|
RUN npm run build
|
|
|
|
WORKDIR /usr/share/nginx/html
|
|
|
|
RUN rm -rf ./*
|
2021-12-28 03:20:21 +08:00
|
|
|
RUN mkdir ./gradio_static/
|
2022-02-04 08:29:58 +08:00
|
|
|
RUN cp -r /gradio/gradio/templates/frontend/. ./gradio_static/
|
2021-12-14 14:02:19 +08:00
|
|
|
RUN cp -r /gradio/website/homepage/dist/. ./
|
|
|
|
RUN cp /gradio/website/homepage/nginx.conf /etc/nginx/conf.d/default.conf
|
|
|
|
|
|
|
|
ENTRYPOINT ["nginx", "-g", "daemon off;"]
|