diff --git a/.env.sample b/.env.sample new file mode 100644 index 0000000..a8826ef --- /dev/null +++ b/.env.sample @@ -0,0 +1,8 @@ +DATA_DIR_PATH= + +WEB_RESTART_MODE= +WEB_RAILS_ENV= +WEB_RAILS_MASTER_KEY= +WEB_RAILS_PORT= + +SOLR_PORT= diff --git a/.gitignore b/.gitignore index b2bd88a..74dfbc7 100644 --- a/.gitignore +++ b/.gitignore @@ -40,3 +40,6 @@ yarn-debug.log* .yarn-integrity db/schema.rb + +.env* +!.env.sample diff --git a/Procfile-prod b/Procfile-prod new file mode 100644 index 0000000..a0364b9 --- /dev/null +++ b/Procfile-prod @@ -0,0 +1 @@ +web: rails s diff --git a/config/application.yml b/config/application.yml index 1ce742a..bb95687 100644 --- a/config/application.yml +++ b/config/application.yml @@ -7,3 +7,5 @@ SENTRY_DSN: '<%= Rails.application.credentials.SENTRY_DSN %>' REPORT_URI_URL: '<%= Rails.application.credentials.REPORT_URI_URL %>' RECAPTCHA_ENABLED: '<%= Rails.application.credentials.RECAPTCHA_ENABLED %>' + +RAILS_SERVE_STATIC_FILES: "true" diff --git a/docker-compose.production.yml b/docker-compose.production.yml index a95c819..00c93bb 100644 --- a/docker-compose.production.yml +++ b/docker-compose.production.yml @@ -4,29 +4,37 @@ services: image: busybox volumes: - .:/var/www - - ./../../shared/bundle:/bundle - - ./../../shared/.bundle:/var/www/.bundle - - ./../../shared/public/assets:/var/www/public/assets - - ./../../shared/public/system:/var/www/public/system - - ./../../shared/storage:/var/www/storage - - ./../../shared/tmp:/var/www/tmp - - ./../../shared/tmp/pids:/var/www/tmp/pids - - ./../../shared/vendor/bundle:/var/www/vendor/bundle - - ./../../shared/node_modules:/var/www/node_modules + - ${DATA_DIR_PATH}/bundle:/bundle + - ${DATA_DIR_PATH}/.bundle:/var/www/.bundle + - ${DATA_DIR_PATH}/public/assets:/var/www/public/assets + - ${DATA_DIR_PATH}/public/system:/var/www/public/system + - ${DATA_DIR_PATH}/storage:/var/www/storage + - ${DATA_DIR_PATH}/tmp:/var/www/tmp + - ${DATA_DIR_PATH}/tmp/pids:/var/www/tmp/pids + - ${DATA_DIR_PATH}/vendor/bundle:/var/www/vendor/bundle + - ${DATA_DIR_PATH}/node_modules:/var/www/node_modules + load_balancer: + image: dockercloud/haproxy + links: + - web + volumes: + - /var/run/docker.sock:/var/run/docker.sock + ports: + - "${WEB_RAILS_PORT}:80" solr: image: tenshiamd/solr:5-alpine ports: - ${SOLR_PORT}:8983 volumes: - - ./../../shared/solr:/var/lib/solr + - ${DATA_DIR_PATH}/solr:/var/lib/solr web: restart: ${WEB_RESTART_MODE} - image: tenshiamd/ruby:2.6-alpine + image: tenshiamd/ruby:2.7-alpine command: | bash -c 'bash -s <