2016-04-14 07:02:28 +02:00
|
|
|
# How to build & run
|
|
|
|
|
|
|
|
## build
|
|
|
|
`docker build --tag=$(basename $PWD) .`
|
|
|
|
|
2016-04-19 07:39:17 +02:00
|
|
|
## 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.
|
|
|
|
|
2016-05-16 18:46:24 +02:00
|
|
|
## start database
|
|
|
|
`docker run --name pitstops_db -e MYSQL_ROOT_PASSWORD=$SOMESECUREPASSWORD$ -e MYSQL_DATABASE=pitstops -d mysql:latest`
|
|
|
|
|
2016-06-21 21:06:41 +02:00
|
|
|
## Database migrations
|
|
|
|
### From *Cathrine* to *Master*:
|
|
|
|
|
|
|
|
`ALTER TABLE pitstop ADD COLUMN costs DECIMAL(5,2) NOT NULL DEFAULT 0.0 AFTER vehicle_id;`
|
|
|
|
|
2016-04-14 07:02:28 +02:00
|
|
|
## run in development
|
2016-04-18 08:13:27 +02:00
|
|
|
|
|
|
|
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.
|
|
|
|
|
2016-07-16 19:29:25 +02:00
|
|
|
`docker run --rm --name rollerverbrauch -ti -v $PWD/app:/app --link pitstops_db:database -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`
|
2016-04-14 07:02:28 +02:00
|
|
|
## run in production
|
2016-04-19 07:39:17 +02:00
|
|
|
`docker run --name pitstops -d -v /data/pitstops/:/data -v /configs/pitstops/:/app/config -p 80:5000 rollerverbrauch`
|
2016-05-16 18:46:24 +02:00
|
|
|
|