Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@embasbm
Last active July 28, 2020 13:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save embasbm/0fa8c1aa469c921ddcd3 to your computer and use it in GitHub Desktop.
Save embasbm/0fa8c1aa469c921ddcd3 to your computer and use it in GitHub Desktop.
docker-compose failing example
default: &default
adapter: mysql2
pool: 5
encoding: utf8
host: db
username: root
password: password
development:
<<: *default
database: myapp_development
test:
<<: *default
database: myapp_test
staging:
<<: *default
database: myapp_stage
production:
<<: *default
database: myapp_production
db:
image: mysql:latest
environment:
MYSQL_ROOT_PASSWORD: password
web:
build: .
command: bundle exec rails s -p 3000 -b '0.0.0.0'
volumes:
- .:/myapp
ports:
- "3000:3000"
links:
- db
FROM ruby:2.2.0
RUN apt-get update -qq && apt-get install -y build-essential
RUN mkdir /myapp
WORKDIR /myapp
ADD Gemfile /myapp/Gemfile
ADD Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
ADD . /myapp
EXPOSE 3000
@embasbm
Copy link
Author

embasbm commented Feb 11, 2016

docker-compose build goes fine
docker-compose up goes fine as well, even though there are some warnings:

...
db_1 | MySQL init process done. Ready for start up.
db_1 | [Warning] Failed to set up SSL because of the following SSL library error: SSL context is not usable without certificate and private key
...
db_1 | [Warning] 'db' entry 'sys mysql.sys@localhost' ignored in --skip-name-resolve mode.
db_1 | [Warning] 'proxies_priv' entry '@ root@localhost' ignored in --skip-name-resolve mode.
db_1 | [Warning] 'tables_priv' entry 'sys_config mysql.sys@localhost' ignored in --skip-name-resolve mode.
db_1 | Version: '5.7.10' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
db_1 | Version: '5.7.10' socket: '/var/run/mysqld/mysqld.sock' port: 3306 MySQL Community Server (GPL)
web_1 | [2016-02-11 18:38:10] INFO WEBrick 1.3.1
web_1 | [2016-02-11 18:38:10] INFO ruby 2.2.0 (2014-12-25) [x86_64-linux]
web_1 | [2016-02-11 18:38:10] INFO WEBrick::HTTPServer#start: pid=1 port=3000

When I ran the run migration commands in other terminal this happen in the current terminal; for (docker-compose run web rake db:create:)

db_1 | [Note] Aborted connection 2 to db: 'unconnected' user: 'root' host: '172.17.0.4' (Got an error reading communication packets)
db_1 | [Note] Aborted connection 3 to db: 'unconnected' user: 'root' host: '172.17.0.4' (Got an error reading communication packets)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment