forked from voc/voctoweb
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Basic Docker containerization for development
This setup uses docker-compose and the official ruby, postgres, elasticsearch, and redis images. The README describes how to set up a development environment, this replaces the old Vagrant setup.
- Loading branch information
Showing
5 changed files
with
93 additions
and
14 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,11 @@ | ||
.git | ||
.gitignore | ||
|
||
Dockerfile | ||
docker-compose.yml | ||
|
||
*.txt | ||
*.md | ||
|
||
tmp | ||
log |
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,12 @@ | ||
# Use the the official Ruby image as a base | ||
FROM ruby:2.4.1 | ||
|
||
# Install runtime dependencies | ||
# Node.js is used for JavaScript compression via the uglifier gem | ||
RUN apt-get update -qq && apt-get install -y nodejs | ||
|
||
WORKDIR /voctoweb | ||
|
||
# Install required gems | ||
COPY Gemfile Gemfile.lock /voctoweb/ | ||
RUN gem install bundler && bundle install |
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
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,21 @@ | ||
default: &default | ||
adapter: postgresql | ||
encoding: utf8 | ||
username: postgres | ||
password: | ||
host: postgres | ||
|
||
development: | ||
<<: *default | ||
database: voctoweb | ||
|
||
# Warning: The database defined as "test" will be erased and | ||
# re-generated from your development database when you run "rake". | ||
# Do not set this db to the same as development or production. | ||
test: | ||
<<: *default | ||
database: voctoweb_test | ||
|
||
production: | ||
<<: *default | ||
database: voctoweb_live |
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,32 @@ | ||
version: '2' | ||
services: | ||
voctoweb: | ||
build: . | ||
command: bundle exec rails s -p 3000 -b '0.0.0.0' | ||
volumes: | ||
- .:/voctoweb | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
- ELASTICSEARCH_URL=elasticsearch:9200 | ||
- REDIS_URL=redis://redis:6379/1 | ||
depends_on: | ||
- sidekiq | ||
- postgres | ||
- elasticsearch | ||
sidekiq: | ||
build: . | ||
command: bundle exec sidekiq | ||
volumes: | ||
- .:/voctoweb | ||
environment: | ||
- REDIS_URL=redis://redis:6379/1 | ||
depends_on: | ||
- postgres | ||
- redis | ||
postgres: | ||
image: postgres:alpine | ||
elasticsearch: | ||
image: elasticsearch:alpine | ||
redis: | ||
image: redis:alpine |