From a9a378654bed04c75c5d00a38fd95a82bea5196f Mon Sep 17 00:00:00 2001 From: juls Date: Tue, 22 Oct 2019 21:15:03 +0800 Subject: [PATCH] Adds README for docker - adds secrets environment for development docker - adds docker db config as basis --- README.md | 13 +++++++++++++ config/database.docker.yml | 19 +++++++++++++++++++ docker-compose.yml | 1 + 3 files changed, 33 insertions(+) create mode 100644 config/database.docker.yml diff --git a/README.md b/README.md index 3009e6f9..8660d233 100644 --- a/README.md +++ b/README.md @@ -96,6 +96,19 @@ If you are new to Rails, follow the [RailsBridge Installfest instructions](http: Client Secret from your Github application * Don't forget to restart your Rails server so it can see your shiny new GitHub key & secret +#### Docker setup + +1. Install docker and docker compose + +1. build + docker-compose build + +1. build + docker-compose run --rm app bash -c bundle + +1. setup DB + docker-compose run --rm app bundle exec rake db:setup + ### Tests Tests, also known as specs, are great! Adding tests is a great pull request all on its own. Please try to write tests when you add or change functionality. diff --git a/config/database.docker.yml b/config/database.docker.yml new file mode 100644 index 00000000..dabdd621 --- /dev/null +++ b/config/database.docker.yml @@ -0,0 +1,19 @@ +development: + adapter: postgresql + host: db + encoding: unicode + database: doubleunion_development + pool: 5 + username: postgres + password: password + template: template0 + +test: &test + adapter: postgresql + host: db + encoding: unicode + database: doubleunion_test + pool: 5 + username: postgres + password: password + template: template0 diff --git a/docker-compose.yml b/docker-compose.yml index 31041076..ba0e6a14 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -25,6 +25,7 @@ services: - PSQL_USERNAME=postgres - PSQL_PASSWORD=password - PSQL_HOST=db + - SECRET_TOKEN=development tty: true stdin_open: true