optimized kwalyon's container building

This commit is contained in:
jsl12
2022-02-09 14:41:54 -06:00
parent 261b0d3c68
commit b82ab54ba6
4 changed files with 32 additions and 21 deletions

View File

@@ -1,16 +1,24 @@
FROM python:latest
FROM python:latest AS build-image
RUN apt update && apt install -y libblas-dev liblapack-dev
RUN python -m pip install --upgrade pip
RUN pip install pandas
RUN pip install nltk
RUN python -m nltk.downloader -d /usr/local/share/nltk_data all
RUN pip install python-dotenv
RUN python -m venv /root/venv
ENV PATH="/root/venv/bin:$PATH"
RUN pip install nextcord
COPY ./requirements.txt ./requirements.txt
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install -r ./requirements.txt
RUN pip install beautifulsoup4 requests lxml
WORKDIR /usr/app/src
FROM python:slim
CMD [ "python", "main.py" ]
RUN apt update && apt install -y libblas-dev liblapack-dev
COPY --from=build-image /root/venv /root/venv
ENV PATH="/root/venv/bin:$PATH"
RUN python -m nltk.downloader words
WORKDIR /usr/app
CMD [ "python", "./src/main.py" ]