-
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.
* [skip travis] add docker development files * move entrypoint to compose file * [skip travis] exclude dev from spec.files * use a docker managed volume for bundler avoids permission issues with non-root user
- Loading branch information
1 parent
6681394
commit 64b6754
Showing
5 changed files
with
48 additions
and
2 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
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,7 @@ | ||
FROM ruby:2.7.0-slim-buster | ||
RUN apt-get update \ | ||
&& apt-get install -yq --no-install-recommends build-essential libsqlite3-dev git curl \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
RUN adduser dev --system --group --uid 1000 | ||
USER dev:dev | ||
RUN gem install rails --version '~> 6.0' --no-document |
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 @@ | ||
--- | ||
version: "3.7" | ||
services: | ||
air: | ||
build: | ||
context: ../ | ||
dockerfile: dev/Dockerfile | ||
image: ngarindungu/rails-dev | ||
entrypoint: ["/bin/bash", "dev/entrypoint.sh"] | ||
command: "bundle exec rake" | ||
working_dir: /home/dev/active_interaction_rails | ||
volumes: | ||
- ../:/home/dev/active_interaction_rails | ||
- bundle:/usr/local/bundle | ||
|
||
volumes: | ||
bundle: |
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 @@ | ||
#!/bin/bash | ||
# clear pid before starting server | ||
rm -f tmp/pids/server.pid | ||
# check if Gemfile has changed and bundle | ||
if [[ -e "Gemfile" ]]; then | ||
bundle check || bundle install | ||
fi | ||
# execute commands | ||
exec "$@" |