forked from DefactoSoftware/Hours
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure for Docker based development
This commit adds the necessary configuration and Docker related files to allow the application and dependencies to run within Docker containers. Utilizing docker-compose, this also allows the orchestration of the separate database, cache, and jobs containers apart from the main application.
- Loading branch information
1 parent
1f9acc2
commit a9640d4
Showing
4 changed files
with
64 additions
and
0 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,17 @@ | ||
FROM ruby:2.3.1 | ||
|
||
RUN apt-get update -yqq \ | ||
&& apt-get install -yqq --no-install-recommends \ | ||
postgresql-client \ | ||
nodejs \ | ||
qt5-default \ | ||
libqt5webkit5-dev \ | ||
&& apt-get -q clean \ | ||
&& rm -rf /var/lib/apt/lists | ||
|
||
WORKDIR /usr/src/app | ||
COPY Gemfile* ./ | ||
RUN bundle install | ||
COPY . . | ||
|
||
CMD bundle exec unicorn -c ./config/unicorn.rb |
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,8 @@ | ||
development: | ||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> | ||
|
||
development: | ||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> | ||
|
||
production: | ||
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> |
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,36 @@ | ||
version: "2" | ||
|
||
volumes: | ||
db-data: | ||
external: false | ||
|
||
services: | ||
cache: | ||
image: memcached:1.4-alpine | ||
|
||
db: | ||
environment: | ||
POSTGRES_USER: | ||
POSTGRES_PASSWORD: | ||
image: postgres:9.5 | ||
volumes: | ||
- db-data:/usr/local/pgsql/data | ||
|
||
jobs: | ||
env_file: .env | ||
build: . | ||
volumes: | ||
- .:/usr/src/app | ||
command: bundle exec rake jobs:work | ||
depends_on: | ||
- db | ||
|
||
app: | ||
env_file: .env | ||
build: . | ||
volumes: | ||
- .:/usr/src/app | ||
ports: | ||
- "8080:8080" | ||
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