-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathDockerfile
60 lines (41 loc) · 1.39 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
50
51
52
53
54
55
56
57
58
59
FROM python:3.9-slim-buster as build
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
RUN apt-get update \
# dependencies for building Python packages
&& apt-get install -y build-essential \
# psycopg2 dependencies
&& apt-get install -y libpq-dev \
# Additional dependencies
&& apt-get install -y telnet netcat \
# cleaning up unused files
&& apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \
&& rm -rf /var/lib/apt/lists/*
RUN mkdir /home/wannadb
WORKDIR /home/wannadb
# install torch
RUN pip install --use-pep517 torch==1.10.0
# Install dependencies
COPY core-requirements.txt core-requirements.txt
RUN pip install --use-pep517 -r core-requirements.txt
COPY backend-requirements.txt backend-requirements.txt
RUN pip install --use-pep517 -r backend-requirements.txt
##################################
## do not change above ##
## changes above cause ##
## long loading times ##
##################################
# Run tests
RUN pip install --use-pep517 pytest
#RUN pytest
FROM build as worker
FROM build as dev
#CMD [ "python", "app.py" ]
CMD ["mypy","--install-types", "--non-interactive"]
CMD ["flask", "--app", "app", "--debug", "run","--host","0.0.0.0", "--port", "8000" ]
FROM build as prod
#copy the rest
COPY . .
RUN chmod +x wannadb_web/entrypoint.sh
# Define the entrypoint.sh
CMD ["sh","./wannadb_web/entrypoint.sh"]