generated from swiss-ai-center/create-a-new-service-generic-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 949 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
36
37
38
# Base image
FROM python:3.11
# Install all required packages to run the model
# TODO: 1. Add any additional packages required to run your model
# RUN apt update && apt install --yes systemd-devel
RUN python -m pip install --upgrade pip
# 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
COPY src/weights.keras src/weights.keras
# 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"]