Created
July 19, 2016 21:18
-
-
Save brylor/e3bc2b0192de9571aff01b6ab08bf46c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
E, [2016-07-19T21:14:51.579333 #7] ERROR -- : PG::ConnectionBad: could not translate host name "db" to address: Name or service not known | |
(Sequel::DatabaseConnectionError) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '2' | |
services: | |
db: | |
build: ./postgres | |
bot: | |
build: . | |
command: /app/runbot.sh | |
volumes: | |
- .:/app | |
links: | |
- "db:database" | |
depends_on: | |
- db |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ruby:2.3.1 | |
COPY . /app/ | |
RUN gem install bundler --no-ri --no-rdoc && \ | |
cd /app; bundle install --without development test | |
RUN apt-get update && apt-get -y install vim sqlite3 | |
RUN chown -R nobody:nogroup /app | |
USER nobody | |
EXPOSE 9292 | |
WORKDIR /app | |
RUN /app/runbot.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM postgres | |
COPY init.sql /docker-entrypoint-initdb.d/ | |
RUN /etc/init.d/postgresql start |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
from the docs
Containers for the linked service will be reachable at a hostname identical to the alias, or the service name if no alias was specified.
expose
orport
5432depends_on
means depends on service, not postgres being up and ready) https://gist.github.com/CzechJiri/29c9862393c6a9d4435a2bfd50cf546d