update docker-compose

pull/142/head
tan 6 years ago
commit 0d561034eb

@ -9,6 +9,5 @@ RUN pip install --no-cache-dir -r requirements.txt
#EXPOSE 5010 #EXPOSE 5010
WORKDIR /usr/src/app/
#CMD [ "python", "run.py" ] #CMD [ "python", "run.py" ]
ENTRYPOINT [ "python", "run.py" ] ENTRYPOINT [ "python", "run.py" ]

@ -0,0 +1,12 @@
version: "3"
services:
ticket:
image: 12306_ticket
build: .
# ports:
volumes:
- ./:/usr/src/app
container_name: 12306ticket

@ -0,0 +1,35 @@
#!/bin/bash
#author: tan
#date: 2019-01-07
# a script to control docker's container create restart reload and rm function
function checkSudo (){
if [ $UID -ne 0 ];then
echo -e 'it must be root!'
echo -e 'usage ./docker.sh {run|restart|rm}'
exit 1
fi
}
checkSudo
if [ $# -eq 1 ];then
case $1 in
"run")
docker-compose up;;
"restart")
docker-compose up --no-recreate;;
"rm")
docker-compose rm -f;;
"drun")
docker-compose up -d;;
*)
echo -e 'usage ./docker.sh {run|restart|rm}';;
esac
fi
Loading…
Cancel
Save