diff --git a/.gitignore b/.gitignore index 55f783a..1a0602a 100644 --- a/.gitignore +++ b/.gitignore @@ -37,4 +37,4 @@ !/app/assets/builds/.keep .DS_Store -# Ignore Mac system files \ No newline at end of file +# Ignore Mac system files diff --git a/README.md b/README.md index fc68a83..80d3211 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ Welcome to the Hack Club Highways. ## Local development -To run this project, you need to first install `ruby`, `ruby-stdlib`, `postgresql-libs` and `gem`. +To run this project, you need to first install `ruby`, `ruby-stdlib`, `postgresql`, `postgresql-libs`, `docker` and `gem`. Then, add the following to your `.zshrc` or `.bashrc` to activate the ruby development environment: ```zsh @@ -17,7 +17,30 @@ Restart your terminal session, and run the following code at the root of the clo gem install rails gem install kamal bundle install --gemfile /home/cyao/Developer/highway/Gemfile + +# Get a sample postgres database.yml +wget https://gist.githubusercontent.com/jwo/4512764/raw/f04e2b7cc94c2d8a63c21dd53741d3d56bc5b021/postgres.database.yml -o config/database.yml ``` -At last, run the executable at `./bin/dev` to start up the development server. +Now, create a postgresql database: +``` +sudo su -l postgres -c "initdb --locale=C.UTF-8 --encoding=UTF8 -D '/var/lib/postgres/data'" +sudo su -l postgres +$ createuser --interactive +Enter name of role to add: sample_postgres +Shall the new role be a superuser? (y/n) y +$ createdb sample_postgres_development +$ createdb sample_postgres_test +$ createdb sample_postgres_production +$ exit +``` + +Start the docker server: +```zsh +bin/rails credentials:edit +docker build . --tag highway:latest +docker run highway +``` + +At last, run the executable at `./bin/setup` to start up the development server! diff --git a/example.env b/example.env index 920aaf3..89b3b70 100644 --- a/example.env +++ b/example.env @@ -1 +1 @@ -SECRET_KEY_BASE=your_actual_secret_key_here \ No newline at end of file +SECRET_KEY_BASE=your_actual_secret_key_here