-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore(language): optimize Dockerfile
- Loading branch information
Showing
10 changed files
with
780 additions
and
1,380 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
__pycache__ | ||
__pycache__ | ||
.pdm-python | ||
.venv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
/__pycache__ | ||
/.idea | ||
/.venv | ||
/.pdm-python |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
FROM python:3.11-slim-bookworm | ||
FROM python:3.12-alpine | ||
|
||
WORKDIR /app | ||
|
||
COPY . . | ||
|
||
RUN apt-get update | ||
RUN apk update | ||
RUN apk add --no-cache build-base | ||
|
||
RUN apt-get install -y curl build-essential python3-poetry rust-all | ||
RUN pip3 install pipx | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
RUN poetry install --no-root | ||
RUN pipx install pdm --python $(which python) | ||
|
||
RUN pip3 install --pre torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/nightly/cpu | ||
RUN pdm install --prod --no-editable | ||
RUN .venv/bin/python3 -m ensurepip | ||
RUN .venv/bin/python3 -m spacy download xx_ent_wiki_sm | ||
|
||
ENV PIP_DEFAULT_TIMEOUT=900 | ||
|
||
RUN poetry run spacy download xx_ent_wiki_sm | ||
|
||
ENTRYPOINT ["poetry", "run", "flask", "run", "--host=0.0.0.0", "--port=8084"] | ||
ENTRYPOINT ["pdm", "run", "flask", "run", "--host=0.0.0.0", "--port=8084"] | ||
|
||
EXPOSE 8084 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.