Skip to content

Commit

Permalink
Add docker instructions for development
Browse files Browse the repository at this point in the history
  • Loading branch information
ryansch committed Jul 31, 2020
1 parent cc96541 commit d65a3b7
Show file tree
Hide file tree
Showing 3 changed files with 58 additions and 0 deletions.
20 changes: 20 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,23 @@ Some things that will increase the chance that your pull request is accepted:
* Write a [good commit message](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html).

*Adapted from [factory_bot_rails's CONTRIBUTING.md](https://github.com/thoughtbot/factory_bot_rails/blob/master/CONTRIBUTING.md).*

## Docker

If you'd rather use a docker container to run the tests, you can use the following instructions.

To set up the container image:

`docker-compose build --pull`

To run specs:

`docker-compose run --rm restforce rspec`

To run rubocop:

`docker-compose run --rm restforce rubocop`

To reset the bundler cache:

`docker-compose down -v`
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
FROM ruby:2.6.5-alpine

RUN apk add --no-cache \
ca-certificates \
wget \
openssl \
bash \
build-base \
git \
sqlite-dev \
tzdata \
tini

ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8

ENV BUNDLER_VERSION 2.1.4
RUN gem install bundler -v ${BUNDLER_VERSION} -i /usr/local/lib/ruby/gems/$(ls /usr/local/lib/ruby/gems) --force

WORKDIR /srv

COPY Gemfile restforce.gemspec /srv/
COPY lib/restforce/version.rb /srv/lib/restforce/version.rb

RUN bundle install

COPY . /srv/

ENTRYPOINT ["/sbin/tini", "-g", "--", "bundle", "exec"]
CMD ["rspec"]
7 changes: 7 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
version: "3.6"
services:
restforce:
build: .
image: restforce:dev
volumes:
- .:/srv

0 comments on commit d65a3b7

Please sign in to comment.