generated from swiss-ai-center/create-a-new-service-generic-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
41 lines (30 loc) · 1.01 KB
/
Dockerfile
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
38
39
40
41
# Base image
FROM python:3.11
# Install all required packages to run the model
RUN apt update && apt install --yes ffmpeg libsm6 libxext6
# Work directory
WORKDIR /app
# Copy requirements file
COPY ./requirements.txt .
COPY ./requirements-all.txt .
# Install dependencies
RUN pip install --requirement requirements.txt --requirement requirements-all.txt
# Create the model directory
RUN mkdir -p src/model
# Download the model file from Hugging Face
RUN wget -O src/model/TATR-v1.1-All-msft.pth https://huggingface.co/bsmock/TATR-v1.1-All/resolve/main/TATR-v1.1-All-msft.pth
# Copy sources
COPY src src
# Environment variables
ENV ENVIRONMENT=${ENVIRONMENT}
ENV LOG_LEVEL=${LOG_LEVEL}
ENV ENGINE_URL=${ENGINE_URL}
ENV MAX_TASKS=${MAX_TASKS}
ENV ENGINE_ANNOUNCE_RETRIES=${ENGINE_ANNOUNCE_RETRIES}
ENV ENGINE_ANNOUNCE_RETRY_DELAY=${ENGINE_ANNOUNCE_RETRY_DELAY}
# Exposed ports
EXPOSE 80
# Switch to src directory
WORKDIR "/app/src"
# Command to run on start
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "80"]