-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 862 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# syntax=docker/dockerfile:1
ARG PYTHON_VERSION=3.10.12
FROM python:${PYTHON_VERSION}-slim as base
# Prevents Python from writing pyc files.
ENV PYTHONDONTWRITEBYTECODE=1
# Keeps Python from buffering stdout and stderr to avoid situations where
# the application crashes without emitting any logs due to buffering.
ENV PYTHONUNBUFFERED=1
ENV MT_API_CONFIG /app/config.json
ENV MODELS_ROOT /app/models
ENV HUGGINGFACE_HUB_CACHE=/app/models \
HF_HUB_ENABLE_HF_TRANSFER=1 \
PORT=80
WORKDIR /app
RUN pip install hf_transfer
COPY ./requirements.txt /app/requirements.txt
RUN python -m pip install -r requirements.txt --no-cache
RUN python -m nltk.downloader -d . punkt
# Copy the source code into the container.
COPY . .
# Expose the port that the application listens on.
EXPOSE 8000
# Run the application.
ENTRYPOINT [ "python", "main.py" ]