-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
30 lines (23 loc) · 849 Bytes
/
Copy pathDockerfile
File metadata and controls
30 lines (23 loc) · 849 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
# Use an official Python runtime as a parent image
FROM python:3.11-slim
# Set the working directory in the container
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY src /app/src
COPY vocab /app/vocab
COPY checkpoints /app/checkpoints
COPY inference.py /app
COPY config.yaml /app
COPY requirements.txt /app
COPY translation_api.py /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
RUN python -m spacy download en_core_web_sm
# Make port 8000 available to the world outside this container
EXPOSE 8000
# Define environment variable
ENV NAME World
# Run app.py when the container launches
CMD ["uvicorn", "translation_api:app", "--host", "0.0.0.0", "--port", "8000"]
# docker build -t translation_api .
# docker run -p 8000:8000 translation_api