-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactoring and dockerizing - Merge.
[Structure] Dockerizing the project
- Loading branch information
Showing
20 changed files
with
579 additions
and
202 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
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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Get image for Python | ||
FROM python:3.8 | ||
|
||
# Set working directory | ||
WORKDIR /app/ | ||
|
||
# pip does not like being run as root, so create a user | ||
RUN useradd --create-home jina | ||
|
||
# Add needed folders locally to container | ||
COPY ./models /app/models | ||
COPY ./tokenizers /app/tokenizers | ||
COPY ./data /app/data | ||
COPY ./embeddings /app/embeddings | ||
|
||
# Give jina user permission to the folders | ||
RUN chown jina models | ||
RUN chown jina tokenizers | ||
RUN chown jina data | ||
RUN chown jina embeddings | ||
|
||
# Switch to user | ||
USER jina | ||
|
||
# Path change needed for huggingface-cli and jina | ||
ENV PYTHONPATH "${PYTHONPATH}:/home/jina/.local/bin" | ||
ENV PATH "${PATH}:/home/jina/.local/bin" | ||
|
||
# Copy the requirements over to the container | ||
COPY ./requirements.txt /app/requirements.txt | ||
|
||
# Install dependencies in the requirements | ||
RUN pip3 install -r requirements.txt | ||
|
||
# Add the src folder locally to container | ||
ADD ./src /app/src | ||
|
||
RUN python src/init.py | ||
|
||
# Expose port | ||
EXPOSE 8020 | ||
|
||
# Run the application | ||
CMD ["python", "src/app.py" ] |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,21 @@ | ||
torch==1.9.0 | ||
transformers==4.9.0 | ||
asgiref==3.4.1 | ||
click==8.0.1 | ||
h11==0.12.0 | ||
uvicorn==0.14.0 | ||
fastapi==0.67.0 | ||
pydantic==1.8.2 | ||
starlette==0.14.2 | ||
typing-extensions==3.10.0.0 | ||
uvloop==0.15.3 | ||
aiohttp==3.7.4.post0 | ||
async-timeout==3.0.1 | ||
attrs==21.2.0 | ||
chardet==4.0.0 | ||
idna==3.2 | ||
multidict==5.1.0 | ||
typing-extensions==3.10.0.0 | ||
yarl==1.6.3 | ||
pandas | ||
jina |
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.