forked from leavez529/Imotion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
49 lines (38 loc) · 1.24 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
42
43
44
45
46
47
48
49
#######################
# Base settings
#######################
# set base image (host OS)
FROM python:3.8
# FROM tiangolo/uwsgi-nginx-flask:python3.6-alpine3.7
#######################
# Install dependencies
#######################
# set the working directory in the container
WORKDIR /imotion
# get model from online gdrive folder
# note: if the file disappears from gdrive...
# - uncomment this line
# - train an artemis model yourself
# - and put it in the folder: ./server/checkpoints/best_model.pt
RUN pip install gdown
RUN gdown https://drive.google.com/uc?id=1MvEBUqFCDflL-Y8TllzYUe_-rivb8bmF \
&& mkdir -p ./server/checkpoints/ \
&& mv best_model.pt ./server/checkpoints/best_model.pt
# install artemis dependencies first
COPY artemis/ ./artemis/
RUN pip install -e ./artemis/
# install imotion dependencies
COPY setup.py ./
RUN pip install -e .
# install corpora
RUN python -m textblob.download_corpora
# cold run image captioning, because it will download additional vocabulary files
COPY server/ ./server/
RUN python -m server.image_captioning
# copy all other files over
COPY . .
#######################
# Expose program
#######################
# command to run on container start
CMD [ "python", "-m", "flask", "run", "--host=0.0.0.0"]