generated from swiss-ai-center/create-a-new-service-generic-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
35 lines (26 loc) · 793 Bytes
/
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
# Base image
FROM python:3.11
# Install all required packages to run the model
RUN apt update && apt install --yes ffmpeg
# 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
# 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"]