docker improvements
This commit is contained in:
@@ -1,17 +0,0 @@
|
|||||||
FROM debian
|
|
||||||
|
|
||||||
RUN apt update && apt install -y \
|
|
||||||
libblas-dev liblapack-dev \
|
|
||||||
libffi-dev libnacl-dev \
|
|
||||||
python3 python3-pip python3-dev
|
|
||||||
|
|
||||||
RUN mkdir -p /kwaylon/src
|
|
||||||
WORKDIR /kwaylon
|
|
||||||
COPY ./requirements.txt ./requirements.txt
|
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install -r ./requirements.txt
|
|
||||||
|
|
||||||
RUN python3 -m nltk.downloader words punkt averaged_perceptron_tagger
|
|
||||||
|
|
||||||
WORKDIR /usr/app
|
|
||||||
COPY ./src /kwaylon/src
|
|
||||||
CMD [ "/kwaylon/src/main.py" ]
|
|
||||||
25
Dockerfile
25
Dockerfile
@@ -1,24 +1,13 @@
|
|||||||
FROM python:latest AS build-image
|
FROM python:latest
|
||||||
|
RUN apt update && apt install -y bash
|
||||||
RUN apt update && apt install -y libblas-dev liblapack-dev
|
|
||||||
|
|
||||||
RUN python -m pip install --upgrade pip
|
RUN python -m pip install --upgrade pip
|
||||||
|
|
||||||
RUN python -m venv /root/venv
|
|
||||||
ENV PATH="/root/venv/bin:$PATH"
|
|
||||||
|
|
||||||
COPY ./requirements.txt ./requirements.txt
|
COPY ./requirements.txt ./requirements.txt
|
||||||
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip pip install -r ./requirements.txt
|
RUN --mount=type=cache,mode=0755,target=/root/.cache/pip python -m pip install -r ./requirements.txt
|
||||||
|
|
||||||
|
|
||||||
FROM python:slim
|
|
||||||
|
|
||||||
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 punkt averaged_perceptron_tagger
|
RUN python -m nltk.downloader words punkt averaged_perceptron_tagger
|
||||||
|
|
||||||
WORKDIR /usr/app
|
RUN mkdir /kwaylon
|
||||||
CMD [ "python", "./src/main.py" ]
|
COPY ./src /kwaylon
|
||||||
|
WORKDIR /kwaylon
|
||||||
|
# CMD [ "python", "main.py" ]
|
||||||
|
|||||||
@@ -5,8 +5,7 @@ services:
|
|||||||
image: kwaylon:latest
|
image: kwaylon:latest
|
||||||
build:
|
build:
|
||||||
context: ./
|
context: ./
|
||||||
dockerfile: .devcontainer/Dockerfile
|
restart: unless-stopped
|
||||||
# restart: unless-stopped
|
|
||||||
network_mode: host
|
network_mode: host
|
||||||
tty: true
|
tty: true
|
||||||
stdin_open: true
|
stdin_open: true
|
||||||
@@ -15,6 +14,3 @@ services:
|
|||||||
- /etc/localtime:/etc/localtime:ro
|
- /etc/localtime:/etc/localtime:ro
|
||||||
- /etc/timezone:/etc/timezone:ro
|
- /etc/timezone:/etc/timezone:ro
|
||||||
- ./:/kwaylon
|
- ./:/kwaylon
|
||||||
# - ./src:/usr/app/src
|
|
||||||
# - ./data:/usr/app/data
|
|
||||||
# - ./pics:/discord_pics
|
|
||||||
|
|||||||
Reference in New Issue
Block a user