mirror of
https://github.com/aljazceru/CTFd.git
synced 2026-02-01 04:14:25 +01:00
Streamlining docker-compose process
This commit is contained in:
@@ -1,17 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
sed "s;sqlite:///ctfd.db;mysql+pymysql://${MYSQL_USER}:${MYSQL_PASSWORD}@db/ctfd;g" CTFd/config.py -i
|
||||
|
||||
# wait for mysql to start
|
||||
cnt=0
|
||||
while ! nc db 3306 >/dev/null 2>&1 < /dev/null; do
|
||||
if [ $cnt -ge 50 ]; then
|
||||
echo "$(date) - db:3306 still not reachable, giving up"
|
||||
exit 1
|
||||
fi
|
||||
echo "$(date) - waiting for db:3306..."
|
||||
sleep 1
|
||||
cnt=`expr $cnt + 1`
|
||||
done
|
||||
|
||||
gunicorn --bind 0.0.0.0:8000 -w 4 "CTFd:create_app()"
|
||||
@@ -1,28 +1,24 @@
|
||||
ctfd:
|
||||
build: .
|
||||
restart: always
|
||||
restart: always
|
||||
ports:
|
||||
- "8000:8000"
|
||||
environment:
|
||||
- &MU MYSQL_USER=ctfd
|
||||
- &MP MYSQL_PASSWORD=You_Should_Probably_Override_This
|
||||
- &MD MYSQL_DATABASE=ctfd
|
||||
command: sh docker-compose-run.sh
|
||||
- DATABASE_URL=mysql+pymysql://root@db/ctfd
|
||||
volumes_from:
|
||||
- data:rw
|
||||
links:
|
||||
- db
|
||||
- db:db
|
||||
|
||||
db:
|
||||
image: mariadb
|
||||
image: mysql
|
||||
environment:
|
||||
- *MU
|
||||
- *MP
|
||||
- *MD
|
||||
- MYSQL_ROOT_PASSWORD=Unencrypted_Credentials_At_Rest
|
||||
- MYSQL_ALLOW_EMPTY_PASSWORD=yes
|
||||
volumes_from:
|
||||
- data:rw
|
||||
|
||||
data:
|
||||
image: mariadb
|
||||
image: mysql
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/lib/mysql
|
||||
|
||||
Reference in New Issue
Block a user