Skip to content

Commit

Permalink
Fixup Docker configuration for local dev (#1519)
Browse files Browse the repository at this point in the history
  • Loading branch information
brynary authored and andrew committed Jun 26, 2017
1 parent 553885a commit b612baf
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 22 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
@@ -0,0 +1,9 @@
.env
.git
*.csv
*.dump
coverage
data
log
node_modules
tmp
6 changes: 2 additions & 4 deletions Dockerfile
@@ -1,14 +1,12 @@
FROM ruby:2.4.0
RUN apt-get update -qq && apt-get install -y build-essential
RUN apt-get install -y libpq-dev
RUN apt-get install -y libxml2-dev libxslt1-dev
RUN apt-get install -y nodejs
RUN apt-get install -y libpq-dev libxml2-dev libxslt1-dev nodejs libicu-dev cmake

ENV APP_HOME /libraries.io
RUN mkdir $APP_HOME
WORKDIR $APP_HOME

ADD Gemfile* $APP_HOME/
RUN bundle install
RUN bundle install --jobs=4

ADD . $APP_HOME
1 change: 0 additions & 1 deletion config/sidekiq.yml
Expand Up @@ -3,7 +3,6 @@
production:
:concurrency: 100
:timeout: 8
:verbose: true
:queues:
- [user, 40]
- [critical, 30]
Expand Down
71 changes: 54 additions & 17 deletions docker-compose.yml
@@ -1,17 +1,54 @@
db:
image: postgres
elasticsearch:
image: elasticsearch:2.4
redis:
image: redis
web:
build: .
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails s -p 3000 -b '0.0.0.0'"
volumes:
- .:/libraries.io
ports:
- "3000:3000"
links:
- db
- elasticsearch
- redis
version: '3.0'

volumes:
postgres-data:
driver: local

redis-data:
driver: local

elasticsearch-data:
driver: local

services:
postgres:
image: postgres:9.6.3
volumes:
- postgres-data:/var/lib/postgresql/data
environment:
- POSTGRES_PASSWORD=not-a-secret
- POSTGRES_USER=librariesio

elasticsearch:
image: elasticsearch:2.4.5
volumes:
- elasticsearch-data:/usr/share/elasticsearch/data
command: -Daction.auto_create_index=true

redis:
image: redis:3.2.9
volumes:
- redis-data:/var/lib/redis
command: redis-server --appendonly yes

sidekiq: &app_base
build:
context: .
image: librariesio/libraries.io
environment:
- DATABASE_URL=postgresql://librariesio:not-a-secret@postgres/librariesio
- REDIS_URL=redis://redis:6379/1
- ELASTICSEARCH_CLUSTER_URL=elasticsearch:9200
volumes:
- .:/libraries.io
depends_on:
- postgres
- elasticsearch
- redis
command: bundle exec sidekiq -C config/sidekiq.yml

web:
<<: *app_base
command: bash -c "rm -f tmp/pids/server.pid && bundle exec rails server --port 3000 --bind '0.0.0.0'"

This comment has been minimized.

Copy link
@movermeyer

movermeyer Jun 23, 2018

Contributor

I think this should be --binding, not --bind.

I get an error starting the web container until I change it,

ports:
- "3000:3000"

0 comments on commit b612baf

Please sign in to comment.