Skip to content
This repository has been archived by the owner on Feb 22, 2023. It is now read-only.

Commit

Permalink
Update the dockerfiles
Browse files Browse the repository at this point in the history
For the "main" one, include the `Gemfile.lock` so builds don't get
confused by newer library versions.

For the "test" one, make it so that guard is its default action.
  • Loading branch information
dazoakley committed Oct 28, 2016
1 parent 06749e6 commit 2a747c1
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 33 deletions.
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
FROM ruby:alpine
MAINTAINER Darren Oakley <[email protected]>

RUN apk add --no-cache ruby-dev build-base libxml2-dev libxslt-dev postgresql-dev mysql-dev openssl-dev
RUN apk add --update --no-cache build-base ruby-dev libxml2-dev libxslt-dev postgresql-dev mysql-dev openssl-dev

ENV APP_HOME /app

RUN mkdir $APP_HOME
WORKDIR $APP_HOME

COPY Gemfile Gemfile

RUN bundle install --jobs 4 --without test development
COPY Gemfile.lock Gemfile.lock
RUN bundle install --retry 10 --jobs 4 --without test

COPY . .

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev → Dockerfile.test
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ RUN bundle install --jobs 4

EXPOSE 5000

CMD [ "bundle exec puma -C config/puma.rb config.ru" ]
CMD [ "bundle exec guard -i -p -l 1" ]
60 changes: 32 additions & 28 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,34 @@
app:
build: .
volumes:
- .:/app
command: 'bundle exec shotgun -p 5000 -o 0.0.0.0 -s puma'
ports:
- '5000:5000'
environment:
RACK_ENV: 'development'
DATABASE_URL: 'postgres://bandiera:bandiera@db/bandiera'
LOG_TO_STDOUT: 'true'
links:
- db
version: '2'
services:
app:
build: .
volumes:
- .:/app
command: 'bundle exec shotgun -p 5000 -o 0.0.0.0 -s puma'
ports:
- '5000:5000'
environment:
RACK_ENV: 'development'
DATABASE_URL: 'postgres://bandiera:bandiera@db/bandiera'
LOG_TO_STDOUT: 'true'
links:
- db

test:
build: .
volumes:
- .:/app
command: 'bundle exec guard -i -p -l 1'
environment:
RACK_ENV: 'test'
LOG_TO_STDOUT: 'true'
test:
build:
context: ./
dockerfile: Dockerfile.test
volumes:
- .:/app
command: 'bundle exec guard -i -p -l 1'
environment:
RACK_ENV: 'test'
LOG_TO_STDOUT: 'true'

db:
image: postgres
ports:
- '5432'
environment:
POSTGRES_USER: 'bandiera'
POSTGRES_PASSWORD: 'bandiera'
db:
image: postgres
ports:
- '5432'
environment:
POSTGRES_USER: 'bandiera'
POSTGRES_PASSWORD: 'bandiera'

0 comments on commit 2a747c1

Please sign in to comment.