-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (29 loc) · 1004 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
FROM python:3.10.3-slim-buster
WORKDIR /app
COPY . .
# Initial Repository PPA Update
RUN apt-get update -y
# Install Container Dependencies
RUN apt-get install unzip curl gpg lsb-release python3-dev default-libmysqlclient-dev build-essential -y
# Install Redis
RUN echo "deb [signed-by=/usr/share/keyrings/redis-archive-keyring.gpg] https://packages.redis.io/deb $(lsb_release -cs) main" | tee /etc/apt/sources.list.d/redis.list
# RUN apt-get update -y
RUN apt-get install redis -y
ENV REDIS_HOST=127.0.0.1
ENV REDIS_PORT=6379
# Unpack pretrained model
RUN pip install gdown
# Replace this with the model version google drive ids
# The file is in the folder model/{version}/saved_model.zip
RUN gdown 1-hFm18fG2NYPQOgnYvG91dxputZ2fbKX
RUN unzip saved_model.zip
RUN rm saved_model.zip
# Prepare python runtime
RUN pip install -r requirements.txt
RUN apt-get autoremove -y
ENV PYTHONUNBUFFERED=1
# Preprare network
ENV HOST 0.0.0.0
EXPOSE 8001
RUN chmod +x ./script_wraper.sh
CMD ./script_wraper.sh