Joachim Lusiardi
0791a23d8c
Conflict between Consumable.vehicles and Vehicle.consumables resolved by making the Consumable.vehicles a read only relationship since we add consumables only to vehicles. Consumable.vehicles is used in the admin view to check if a consumable can be deleted safely. |
||
---|---|---|
app | ||
compose_config | ||
database_upgrades | ||
tests | ||
.gitattributes | ||
.gitignore | ||
config.py | ||
create_icons.sh | ||
docker-compose.yml | ||
Dockerfile | ||
icon_orig.png | ||
main.py | ||
README.md | ||
requirements.txt |
How to build & run
build
docker build --tag=$(basename $PWD) .
general configuration
Look at app/config/email.py.example for the configuration of the parameters required for sending emails. Copy the file as email.py to a folder that will serve as configuration directory and fill in the information. The directory will be used as volume during container operation.
start database
docker run --name pitstops_db -e MYSQL_ROOT_PASSWORD=$SOMESECUREPASSWORD$ -e MYSQL_DATABASE=pitstops -d mysql:latest
or
docker run --name pitstops_db -e MYSQL_ROOT_PASSWORD=$SOMESECUREPASSWORD$ -e MYSQL_DATABASE=pitstops -d mariadb:latest
Database migrations
From Cathrine to Master:
ALTER TABLE pitstop ADD COLUMN costs DECIMAL(5,2) NOT NULL DEFAULT 0.0 AFTER vehicle_id;
run in development
Include the development version of the code as volume, so the app gets reloaded automatically. The sqlite file will be stored in tmp so it can be inspected with tools like sqlite3. The switch DEBUG enables debugging during development.
docker run --rm --name rollerverbrauch -ti -v $PWD/app:/app -v $PWD/data:/data -p 5000:5000 -e SECURITY_PASSWORD_SALT=XXX -e SECRET_KEY=XXX -e MAIL_SERVER=XXX -e MAIL_USERNAME=XXX -e MAIL_PASSWORD=XXX rollerverbrauch
run in production
docker run --name pitstops -tid -e PROXY_DATA=server_names:ps.lusiardi.de,port:5000 --link pitstops_db:database -e SECURITY_PASSWORD_SALT=XXX -e SECRET_KEY=XXX -e MAIL_SERVER=XXX -e MAIL_USERNAME=XXX -e MAIL_PASSWORD=XXX rollerverbrauch:catherine