diff --git a/.gitignore b/.gitignore index a6ef4ba1..0291b16c 100644 --- a/.gitignore +++ b/.gitignore @@ -21,8 +21,9 @@ /tmp config/deploy.rb config/site.yml +config/database.yml db/data.yml nbproject rerun.txt tags -.skip-docker +.use-docker diff --git a/doc/installation.md b/doc/installation.md index 158f7723..f47db6a7 100644 --- a/doc/installation.md +++ b/doc/installation.md @@ -55,12 +55,17 @@ Tracks container. In future there should be an official image in Docker Hub. You postgres=# CREATE USER tracks WITH ENCRYPTED PASSWORD 'password-goes-here'; postgres=# CREATE DATABASE tracks OWNER=tracks; ``` -4. Start the Tracks container: +4. Install the schema +``` + $ docker run --link mariadb:db --rm -t tracks bin/rake db:reset + $ docker run --link postgres:db --rm -t tracks bin/rake db:reset +``` +5. Start the Tracks server: ``` $ docker run -p 3000:3000 --name tracks --link mariadb:db -t tracks $ docker run -p 3000:3000 --name tracks --link postgres:db -t tracks ``` -5. You should now be able to access Tracks in http://localhost:3000 +6. You should now be able to access Tracks in http://localhost:3000 ## Environmental variables in the Docker image diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 12fe9243..bc38d35b 100755 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -17,6 +17,4 @@ export DATABASE_ENCODING=${DATABASE_ENCODING:-utf8} export RAILS_SERVE_STATIC_FILES=TRUE export RAILS_LOG_TO_STDOUT=TRUE -rails db:migrate - exec "$@" diff --git a/script/bootstrap b/script/bootstrap index 6d90255a..ef8fc435 100755 --- a/script/bootstrap +++ b/script/bootstrap @@ -9,3 +9,6 @@ docker_compose="docker-compose --file docker-compose.yml" echo "==> Building Docker image…" $docker_compose build + +echo "==> Building assets…" +bin/rake assets:precompile diff --git a/script/setup b/script/setup index b9422290..c4bc29a9 100755 --- a/script/setup +++ b/script/setup @@ -13,6 +13,6 @@ script/poll-for-db echo "==> Setting up DB…" # reset database to a fresh state. -bin/rake db:create db:reset +bin/rake db:reset echo "==> App is now ready to go!"