From 1e7c3776590d3f182e54274c399b91f41df73f8a Mon Sep 17 00:00:00 2001 From: Ari Timonen Date: Sat, 14 Nov 2020 10:09:59 +0200 Subject: [PATCH] Update docs and compose files --- .gitignore | 1 + DEVELOPMENT.md | 15 ++++++++------- README.md | 6 +++++- docker-compose.production.yml | 6 ++++++ docker-compose.yml | 5 ----- spec/spec_helper.rb | 4 ++-- 6 files changed, 22 insertions(+), 15 deletions(-) create mode 100644 docker-compose.production.yml diff --git a/.gitignore b/.gitignore index 034c661..d212df9 100644 --- a/.gitignore +++ b/.gitignore @@ -10,6 +10,7 @@ .env*.local .tmp* .rspec +test*.log # Cache files .sass-cache diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index bb4bf3e..ec8d8a1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -1,6 +1,6 @@ # Development -Install instructions in INSTALL.md. Read this whole documentation before proceeding. +Install instructions in INSTALL.md. Read it before proceeding. ## Basic commands for development @@ -8,9 +8,9 @@ Load env variables (**don't skip this step**): source script/env.sh .env .env.development -Start: +Start development: - docker-compose up --build development` + docker-compose up --build development Build or rebuild: @@ -33,10 +33,11 @@ Restart the web container Run some tests: + docker-compose up --build test docker-compose exec -u web test bundle exec rspec` docker-compose exec -u web test bundle exec rspec spec/controllers/shoutmsgs_controller_spec.rb` -## Unresolved issues for dev +## Unresolved issues for development There are some unresolved issues to setup dev env. @@ -75,7 +76,7 @@ Read this to understand design decisions and follow them! 1. Env variables should be used everywhere and loaded from .env* files using Dotenv * Load order is in [here]|(https://github.com/bkeepers/dotenv#what-other-env-files-can-i-use) - * Local changes go to .env*local and NOT .env + * Local changes go to .env*local and **not** .env * Passwords are in ENV variables for now so they don't have to duplicated between DB and Rails. 1. Everything should be running on containers. * Docker-compose is the heart of deployment @@ -85,10 +86,10 @@ Read this to understand design decisions and follow them! * For production or staging could have the content in either image or as a volume. Doesn't really matter. 1. The public directory contains everything public. NGINX will try to find files there and ask from PUMA if it doesn't. * The local public directories (images, files, icons, avatars etc.) are to be addeed to .gitignore - * Assets are compiled on-fly in development mode. + * Assets are compiled on-fly in development mode. * In production/staging etc. assets are precompiled and stored. Entry script can do this. * The public folder is a mix of auto-generated data (assets), static data (images) and user-generated data (avatars/files etc.). - * No app folder in repo outside public is supposed to shared by webserver. + * No app folder in repo outside public is supposed to be shared by webserver. 1. Do not comment out tests that are taken out of use temporarily but use **skip** ## Tags in code diff --git a/README.md b/README.md index c6cb0cb..726fb85 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,11 @@ This is the source code of ENSL website. Currently deployed on [ensl.org](https://www.ensl.org). -Features: +## Documentation + +See [[INSTALL.md]] how to install and [[DEVELOPMENT.md]] how to develop it. + +## Features - Articles - Commenting feature for most objects diff --git a/docker-compose.production.yml b/docker-compose.production.yml new file mode 100644 index 0000000..a54fce1 --- /dev/null +++ b/docker-compose.production.yml @@ -0,0 +1,6 @@ +version: "3.4" + +networks: + default: + external: + name: catpack_docker diff --git a/docker-compose.yml b/docker-compose.yml index 2198d4d..a608166 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -196,8 +196,3 @@ services: # commands, but it is necessary for "spring status" and "spring stop" # to work properly. # pid: host - -networks: - default: - external: - name: catpack_docker diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 608fb40..bbba6bc 100755 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -43,8 +43,8 @@ Capybara.register_driver :selenium_remote do |app| end Capybara.default_max_wait_time = 8 -#Capybara.javascript_driver = :selenium -#Capybara.javascript_driver = :selenium_remote +# Capybara.javascript_driver = :selenium +# Capybara.javascript_driver = :selenium_remote #print('selenium %s' % SELENIUM_HOST) #print('port %d' % [TEST_APP_PORT])