Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixup Docker configuration for local dev (#1519)
- Loading branch information
Showing
4 changed files
with
65 additions
and
22 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
.env | ||
.git | ||
*.csv | ||
*.dump | ||
coverage | ||
data | ||
log | ||
node_modules | ||
tmp |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,6 @@ | |
production: | ||
:concurrency: 100 | ||
:timeout: 8 | ||
:verbose: true | ||
:queues: | ||
- [user, 40] | ||
- [critical, 30] | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.
Sorry, something went wrong. |
||
ports: | ||
- "3000:3000" |
I think this should be
--binding
, not--bind
.I get an error starting the
web
container until I change it,