diff options
| author | Mitch Riedstra <mitch@riedstra.us> | 2019-03-27 23:06:36 -0400 |
|---|---|---|
| committer | Mitch Riedstra <mitch@riedstra.us> | 2019-03-27 23:06:36 -0400 |
| commit | c49d9e0d69685d022fa6ffaa04f91bbe46f67551 (patch) | |
| tree | 5f100e3f9b70340f2e642de286cda01183b6e5b4 /docker-scripts | |
| parent | 35dddcfc0dc2ded193a6b503f9ff4a5a3cd68439 (diff) | |
| download | dispatch-tracker-c49d9e0d69685d022fa6ffaa04f91bbe46f67551.tar.gz dispatch-tracker-c49d9e0d69685d022fa6ffaa04f91bbe46f67551.tar.xz | |
Fully dockerized environment
Diffstat (limited to 'docker-scripts')
| -rwxr-xr-x | docker-scripts/setup.sh | 28 | ||||
| -rwxr-xr-x | docker-scripts/shell.sh | 11 | ||||
| -rw-r--r-- | docker-scripts/uwsgi.sh | 17 |
3 files changed, 56 insertions, 0 deletions
diff --git a/docker-scripts/setup.sh b/docker-scripts/setup.sh new file mode 100755 index 0000000..e036aa8 --- /dev/null +++ b/docker-scripts/setup.sh @@ -0,0 +1,28 @@ +#!/bin/sh + +# Dumps you to a shell inside of the app container + +docker run --rm -it \ + --network dispatch-tracker_backend \ + -v $(pwd)/static:/static \ + -v $(pwd)/app:/app \ + dispatch-app \ + sh -x -e -c ' + cd /app; + export CUSTOM_CONFIG=config-compose.yml + echo "create database dispatch;" | psql -U postgres -h postgres + python3 ./manage.py collectstatic + python3 ./manage.py migrate + python3 ./manage.py createsuperuser + + v="" + while ! [ "$v" = "done" ] ; do + printf "Please login to the system and fill out the form," + printf "then come back, type \"done\" to continue:\t" + read v; + done + + python3 ./manage.py insert_fake_data --companies 10 --users 10 \ + --loads 400 --start-date='"'"'-16w'"'"' --end-date='"'"'+16w'"'"' \ + --attachments=true \ + --invoices=true' diff --git a/docker-scripts/shell.sh b/docker-scripts/shell.sh new file mode 100755 index 0000000..4a417c0 --- /dev/null +++ b/docker-scripts/shell.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Dumps you to a shell inside of the app container + +docker run --rm -it \ + --network dispatch-tracker_backend \ + -v $(pwd)/static:/static \ + -v $(pwd)/app:/app \ + --user 0 \ + dispatch-app \ + ash diff --git a/docker-scripts/uwsgi.sh b/docker-scripts/uwsgi.sh new file mode 100644 index 0000000..26c57fe --- /dev/null +++ b/docker-scripts/uwsgi.sh @@ -0,0 +1,17 @@ +#!/bin/sh +set -e +set -x +cd /app + +uwsgi \ + --socket 0.0.0.0:9200 \ + --env CUSTOM_CONFIG=/app/config.yml \ + --processes 1 \ + --threads 4 \ + --uid uwsgi \ + wsgi:application + +ls -la + + +echo "MOTHERFUCKER" |
