mirror of https://github.com/JohnHammond/CTFd.git
parent
e3fd784d91
commit
4b077dfa37
|
@ -1,7 +1,7 @@
|
|||
FROM ubuntu:latest
|
||||
RUN apt-get update -y
|
||||
RUN apt-get upgrade -y
|
||||
RUN apt-get install build-essential python-dev python-pip libffi-dev -y
|
||||
RUN apt-get install build-essential python-dev python-pip libffi-dev mysql-client -y
|
||||
|
||||
VOLUME ["/opt/CTFd"]
|
||||
|
||||
|
@ -12,5 +12,9 @@ WORKDIR /opt/CTFd
|
|||
RUN pip install -r requirements.txt
|
||||
RUN pip install pymysql
|
||||
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "-w", "4", "CTFd:create_app()", "--access-logfile", "/opt/CTFd/CTFd/logs/access.log", "--error-logfile", "/opt/CTFd/CTFd/logs/error.log"]
|
||||
RUN chmod +x /opt/CTFd/docker-entrypoint.sh
|
||||
|
||||
EXPOSE 8000
|
||||
|
||||
ENTRYPOINT ["/opt/CTFd/docker-entrypoint.sh"]
|
||||
CMD ["gunicorn", "--bind", "0.0.0.0:8000", "-w", "4", "CTFd:create_app()", "--access-logfile", "/opt/CTFd/CTFd/logs/access.log", "--error-logfile", "/opt/CTFd/CTFd/logs/error.log"]
|
|
@ -0,0 +1,15 @@
|
|||
#!/bin/sh
|
||||
|
||||
# http://stackoverflow.com/questions/25503412/how-do-i-know-when-my-docker-mysql-container-is-up-and-mysql-is-ready-for-taking#29793382
|
||||
echo "Waiting on MySQL"
|
||||
while ! mysqladmin ping -h db --silent; do
|
||||
# Show some progress
|
||||
echo -n '.';
|
||||
sleep 1;
|
||||
done
|
||||
echo "Ready"
|
||||
# Give it another second.
|
||||
sleep 1;
|
||||
|
||||
echo "Starting CTFd"
|
||||
gunicorn --bind 0.0.0.0:8000 -w 4 'CTFd:create_app()' --access-logfile '/opt/CTFd/CTFd/logs/access.log' --error-logfile '/opt/CTFd/CTFd/logs/error.log'
|
Loading…
Reference in New Issue