forked from jimmy201602/workflowdemo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
41 lines (37 loc) · 1.49 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
#workflowdemo dockfile
FROM ubuntu:latest
LABEL maintainer zhengge2012@gmail.com
WORKDIR /opt
RUN apt-get update -y
RUN apt-get install -y mysql-server libmysqlclient-dev redis-server python3 python3-pip python3-dev git supervisor nginx
RUN sed -i 's/bind 127.0.0.1 ::1/bind 127.0.0.1/g' /etc/redis/redis.conf
#clone workflowdemo code
RUN mkdir -p /var/log/web
WORKDIR /opt
RUN git clone https://github.com/jimmy201602/workflowdemo.git
WORKDIR /opt/workflowdemo
RUN pip3 install -r requirements.txt
RUN python3 manage.py makemigrations
RUN python3 manage.py migrate
RUN python3 createsuperuser.py
#clone loonflow code
WORKDIR /opt
RUN git clone https://github.com/blackholll/loonflow.git
WORKDIR /opt/loonflow
RUN git checkout develop
WORKDIR /opt/loonflow/requirements
RUN pip3 install -r dev.txt
#create database user and import data
#RUN service mysql restart
#RUN mysql -uroot -e "CREATE DATABASE if not exists loonflownew DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;"
#RUN mysql -uroot -e "CREATE USER loonflownew@127.0.0.1 IDENTIFIED BY '123456'";
#RUN mysql -uroot -e "GRANT ALL PRIVILEGES ON loonflownew.* TO 'loonflownew'@'127.0.0.1';"
#RUN mysql --one-database loonflownew < /opt/workflowdemo/loonflow.sql
ADD nginx.conf /etc/nginx/nginx.conf
ADD supervisord.conf /etc/supervisor/supervisord.conf
ADD docker-entrypoint.sh /docker-entrypoint.sh
RUN chmod +x /docker-entrypoint.sh
RUN cp -rf /opt/loonflow/static/* /opt/workflowdemo/static/
EXPOSE 80
EXPOSE 8000
CMD ["/docker-entrypoint.sh", "start"]