Changed docker data volume to project specific name
This commit is contained in:
parent
2f29555240
commit
5ae3ac82e1
6 changed files with 515 additions and 3 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
APP_NAME="Hoschis Tippspiel"
|
APP_NAME="Hoschis Tippspiel"
|
||||||
APP_ENV=local
|
APP_ENV=local
|
||||||
APP_KEY=base64:dfy2mOUn+iJB57CxYbG/Oukhozcd4oNput/8Ofq8gMQ=
|
APP_KEY=base64:skYbYLqiGeOCTWD7J9xHzAKgmwuTkknm9BLGinIgn88=
|
||||||
APP_DEBUG=true
|
APP_DEBUG=true
|
||||||
APP_LOG_LEVEL=debug
|
APP_LOG_LEVEL=debug
|
||||||
APP_URL=http://localhost
|
APP_URL=http://localhost
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ services:
|
||||||
SERVICE_TAGS: dev
|
SERVICE_TAGS: dev
|
||||||
SERVICE_NAME: mysql
|
SERVICE_NAME: mysql
|
||||||
volumes:
|
volumes:
|
||||||
- dbdata:/var/lib/mysql
|
- dbdata_pfosten:/var/lib/mysql
|
||||||
- ./docker-compose/mysql/my.cnf:/etc/mysql/my.cnf
|
- ./docker-compose/mysql/my.cnf:/etc/mysql/my.cnf
|
||||||
- ./docker-compose/mysql/init:/docker-entrypoint-initdb.d
|
- ./docker-compose/mysql/init:/docker-entrypoint-initdb.d
|
||||||
ports:
|
ports:
|
||||||
|
|
@ -53,6 +53,6 @@ networks:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
dbdata:
|
dbdata_pfosten:
|
||||||
driver: local
|
driver: local
|
||||||
|
|
||||||
|
|
|
||||||
29
tools/demo_query.py
Normal file
29
tools/demo_query.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
# This script needs mysql driver:
|
||||||
|
# pip3 install mysql
|
||||||
|
|
||||||
|
import MySQLdb
|
||||||
|
|
||||||
|
db = MySQLdb.connect(host ="hoschis-tippspiel.de", # your host, usually localhost
|
||||||
|
user ="d0274241", # your username
|
||||||
|
passwd="superpfosten!", # your password
|
||||||
|
db ="d0274241") # name of the data base
|
||||||
|
|
||||||
|
# you must create a Cursor object. It will let
|
||||||
|
# you execute all the queries you need
|
||||||
|
cur = db.cursor()
|
||||||
|
|
||||||
|
# Use all the SQL you like
|
||||||
|
cur.execute("SELECT * FROM seasons")
|
||||||
|
|
||||||
|
# Column namnes
|
||||||
|
arr=[]
|
||||||
|
for i in range(0,len(cur.description)):
|
||||||
|
arr.append(cur.description[i][0])
|
||||||
|
print(";".join(arr))
|
||||||
|
|
||||||
|
for row in cur.fetchall():
|
||||||
|
print (row)
|
||||||
|
print("---")
|
||||||
|
|
||||||
|
|
||||||
|
db.close()
|
||||||
12
tools/dump_pfosten.py
Normal file
12
tools/dump_pfosten.py
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# This script needs mysqldump to be installed
|
||||||
|
# apt install mysql-client
|
||||||
|
|
||||||
|
import os
|
||||||
|
import datetime
|
||||||
|
|
||||||
|
str_now=datetime.datetime.now().strftime('%Y-%m-%d_%H%M%S')
|
||||||
|
|
||||||
|
filename="pfosten_"+str_now+".sql"
|
||||||
|
print("Dumping "+filename)
|
||||||
|
cmd="""mysqldump -ud0274241 -psuperpfosten! -h hoschis-tippspiel.de d0274241 > """+filename
|
||||||
|
os.system(cmd)
|
||||||
2
tools/dumpdb
Normal file
2
tools/dumpdb
Normal file
|
|
@ -0,0 +1,2 @@
|
||||||
|
echo "Running dump_pfosten.py"
|
||||||
|
python dump_pfosten.py
|
||||||
469
tools/pfosten_2022-03-25_105651.sql
Normal file
469
tools/pfosten_2022-03-25_105651.sql
Normal file
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue