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.
Merge pull request DefactoSoftware#391 from coderjourney/dockerize-ap…
…plication Configure for Docker based development
- Loading branch information
Showing
7 changed files
with
106 additions
and
1 deletion.
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
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 @@ | ||
#!/usr/bin/env sh | ||
|
||
# Exit if any subcommand fails | ||
set -e | ||
|
||
# Set up database.yml | ||
if [ ! -f config/database.yml ]; then | ||
cp config/database.yml.example config/database.yml | ||
fi | ||
|
||
# Set up configurable environment variables | ||
if [ ! -f .env ]; then | ||
cp .sample.env .env | ||
echo "POSTGRES_HOST=db" >> .env | ||
echo "POSTGRES_USER=hours" >> .env | ||
echo "POSTGRES_PASSWORD=secure_password" >> .env | ||
fi |
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,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: | ||
- "7000: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