-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdockerfile
41 lines (22 loc) · 853 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
39
40
41
FROM python:3.7-buster
ARG username="testusername"
ARG password="testpassword"
COPY ./backend /MLPDA/src/backend
COPY ./Frontend/build /MLPDA/src/Frontend/build
COPY ./MachineLearning /MLPDA/src/MachineLearning
COPY ./requirements.txt /MLPDA/src
RUN pip install -r /MLPDA/src/requirements.txt
RUN apt-get update && apt-get install -y nginx
COPY ./nginx.conf /etc/nginx/sites-available/default
RUN ln -sf /dev/stdout /var/log/nginx/access.log \
&& ln -sf /dev/stderr /var/log/nginx/error.log
RUN chown -R www-data:www-data /MLPDA
WORKDIR /MLPDA/src/backend/mlpda_backend/
RUN sed -i.bak 's/\r$//' launch_server.sh
RUN chmod +x launch_server.sh
RUN python3 manage.py makemigrations
RUN python3 manage.py migrate
RUN python3 manage.py sampleuser -u ${username} -p ${password}
EXPOSE 8000
STOPSIGNAL SIGTERM
CMD ["./launch_server.sh"]