Hello,
I’m trying to install Fabmanager with Docker, but I’m having this problem.
could not connect to server: Connection refused
Is the server running on host "postgres" (172.18.0.4) and accepting
TCP/IP connections on port 5432?
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `initialize'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `new'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:651:in `connect'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:242:in `initialize'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `new'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/postgresql_adapter.rb:44:in `postgresql_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:438:in `new_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:448:in `checkout_new_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:422:in `acquire_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:349:in `block in checkout'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:348:in `checkout'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:263:in `block in connection'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:262:in `connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_adapters/abstract/connection_pool.rb:571:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:113:in `retrieve_connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/connection_handling.rb:87:in `connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:6:in `connection'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/postgresql_database_tasks.rb:15:in `create'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:93:in `create'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:107:in `block in create_current'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:278:in `block in each_current_configuration'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:277:in `each_current_configuration'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/tasks/database_tasks.rb:106:in `create_current'
/usr/local/bundle/gems/activerecord-4.2.10/lib/active_record/railties/databases.rake:17:in `block (2 levels) in <top (required)>'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:251:in `block in execute'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:251:in `each'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:251:in `execute'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:195:in `block in invoke_with_call_chain'
/usr/local/lib/ruby/2.3.0/monitor.rb:214:in `mon_synchronize'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:188:in `invoke_with_call_chain'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/task.rb:181:in `invoke'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:160:in `invoke_task'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:116:in `block (2 levels) in top_level'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:116:in `each'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:116:in `block in top_level'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:125:in `run_with_threads'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:110:in `top_level'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:83:in `block in run'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/bundle/gems/rake-12.2.1/lib/rake/application.rb:80:in `run'
/usr/local/bundle/gems/rake-12.2.1/exe/rake:27:in `<top (required)>'
/usr/local/bundle/bin/rake:23:in `load'
/usr/local/bundle/bin/rake:23:in `<top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:74:in `kernel_load'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli/exec.rb:28:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli.rb:424:in `exec'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/invocation.rb:126:in `invoke_command'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor.rb:387:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli.rb:27:in `dispatch'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/vendor/thor/lib/thor/base.rb:466:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/cli.rb:18:in `start'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/exe/bundle:30:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/lib/bundler/friendly_errors.rb:124:in `with_friendly_errors'
/usr/local/lib/ruby/gems/2.3.0/gems/bundler-1.16.5/exe/bundle:22:in `<top (required)>'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `<main>'
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>25, "username"=>"postgres", "password"=>nil, "host"=>"postgres", "database"=>"fablab_production"}
Do you know what is wrong?
I give you below a copy of my configuration files.
Thank you in advance for your help.
Sincerely,
Simon
docker-compose.yml
version: '2'
services:
fabmanager:
image: sleede/fab-manager
environment:
RAILS_ENV: production
RACK_ENV: production
env_file:
- ./config/env
volumes:
- ./public/assets:/usr/src/app/public/assets
- ./public/uploads:/usr/src/app/public/uploads
- ./invoices:/usr/src/app/invoices
- ./exports:/usr/src/app/exports
- ./log:/var/log/supervisor
- ./plugins:/usr/src/app/plugins
depends_on:
- postgres
- redis
- elasticsearch
restart: always
postgres:
image: postgres:9.4
volumes:
- ./postgresql:/var/lib/postgresql/data
restart: always
elasticsearch:
image: elasticsearch:5.6
environment:
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
volumes:
- ./elasticsearch:/usr/share/elasticsearch/data
restart: always
redis:
image: redis:3.0
volumes:
- ./redis:/data
restart: always
nginx:
image: nginx:1.9
ports:
- "80:80"
- "443:443"
volumes:
- ./config/nginx:/etc/nginx/conf.d
- ./letsencrypt/etc:/etc/letsencrypt
- ./log:/var/log/nginx
volumes_from:
- fabmanager:ro
links:
- fabmanager:fabmanager
restart: always
config/env
POSTGRES_HOST=postgres
REDIS_HOST=redis
ELASTICSEARCH_HOST=elasticsearch
SECRET_KEY_BASE=
STRIPE_API_KEY=
STRIPE_PUBLISHABLE_KEY=
STRIPE_CURRENCY=eur
INVOICE_PREFIX=Demo-FabLab-facture
FABLAB_WITHOUT_PLANS=false
FABLAB_WITHOUT_SPACES=true
DEFAULT_MAIL_FROM=Fab Manager Demo <noreply@fab-manager.com>
DEFAULT_HOST=localhost
DEFAULT_PROTOCOL=http
DELIVERY_METHOD=smtp
SMTP_ADDRESS=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER_NAME=
SMTP_PASSWORD=
SMTP_AUTHENTICATION=plain
SMTP_ENABLE_STARTTLS_AUTO=true
SMTP_OPENSSL_VERIFY_MODE=
GA_ID=
DISQUS_SHORTNAME=
TWITTER_NAME=FablabGrenoble
TWITTER_CONSUMER_KEY=
TWITTER_CONSUMER_SECRET=
TWITTER_ACCESS_TOKEN=
TWITTER_ACCESS_TOKEN_SECRET=
FACEBOOK_APP_ID=
RAILS_LOCALE=fr
APP_LOCALE=fr
MOMENT_LOCALE=fr
SUMMERNOTE_LOCALE=fr-FR
ANGULAR_LOCALE=fr-fr
MESSAGEFORMAT_LOCALE=fr
FULLCALENDAR_LOCALE=fr
ELASTICSEARCH_LANGUAGE_ANALYZER=french
TIME_ZONE=Paris
WEEK_STARTING_DAY=monday
D3_DATE_FORMAT=%d/%m/%y
UIB_DATE_FORMAT=dd/MM/yyyy
EXCEL_DATE_FORMAT=dd/mm/yyyy
OPENLAB_APP_SECRET=
OPENLAB_APP_ID=
OPENLAB_BASE_URI=https://openprojects.fab-manager.com
NAVINUM_API_LOGIN=
NAVINUM_API_PASSWORD=
LOG_LEVEL=debug
ALLOWED_EXTENSIONS=pdf ai eps cad math svg stl dxf dwg obj step iges igs 3dm 3dmf doc docx png ino scad fcad skp sldprt sldasm slddrw slddrt tex latex ps
ALLOWED_MIME_TYPES=application/pdf application/postscript application/illustrator image/x-eps image/svg+xml application/sla application/dxf application/acad application/dwg application/octet-stream > application/step application/iges model/iges x-world/x-3dmf application/ application/vnd.openxmlformats-officedocument.wordprocessingml.document image/png text/x-arduino text/plain application/scad > application/vnd.sketchup.skp application/x-koan application/vnd-koan koan/x-skm application/vnd.koan application/x-tex application/x-latex
# 10485760 = 10 megabytes
MAX_IMAGE_SIZE=10485760
config/nginx/fabmanager.conf
upstream puma {
server fabmanager:3000;
}
server {
listen 80;
server_name localhost;
root /usr/src/app/public;
location ^~ /assets/ {
gzip_static on;
expires max;
add_header Cache-Control public;
}
try_files $uri/index.html $uri @puma;
location @puma {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_pass http://puma;
}
client_max_body_size 4G;
keepalive_timeout 10;
error_page 500 502 504 /500.html;
error_page 503 @503;
# Return a 503 error if the maintenance page exists.
if (-f /usr/src/app/public/maintenance.html) {
return 503;
}
location @503 {
# Serve static assets if found.
if (-f $request_filename) {
break;
}
# Set root to the shared directory.
root /usr/src/app/public/;
rewrite ^(.*)$ /maintenance.html break;
}
location /.well-known/acme-challenge {
root /etc/letsencrypt/webrootauth;
default_type "text/plain";
}
# no spam bot
if ($http_referer ~* (guardlink.org|free-share-buttons|social-buttons|buy-cheap-online.info|social-buttons.com|free-share-buttons.com|darodar.com|blackhatworth.com|hulfingtonpost.com|priceg.com|semalt> .com|imaspammer.com|iedit.ilovevitaly.com|7makemoneyonline.com|iedit.ilovevitaly.com|7makemoneyonline.com|gamersyde.com|iloveitaly.com|econom.co|semalt.com|forum.topic44637676.darodar.com|darodar.com|> iskalko.ru|ilovevitaly.ru|ilovevitaly.com|ilovevitaly.co|o-o-8-o-o.ru|o-o-6-o-o.ru|buttons-for-website.com|semalt.semalt.com|cenoval.ru|priceg.com|darodar.com|cenokos.ru|seoexperimenty.ru|gobongo.info> |vodkoved.ru|adcash.com|websocial.me|cityadspix.com|luxup.ru|ykecwqlixx.ru|superiends.org|slftsdybbg.ru|edakgfvwql.ru|socialseet.ru|screentoolkit.com|econom.co|semalt.com|savetubevideo.com|shopping.il> ovevitaly.com|iedit.ilovevitaly.com|forum.topic52548358.darodar.com|forum.topic53813291.darodar.com|share-buttons.com|event-tracking.com|success-seo.com|free-floating-buttons.com|get-free-social-traff> ic.com|chinese-amezon.com|get-free-traffic-now.com|free-social-buttons.com|videos-for-your-business.com)) { return 403; }
}