Skip to content
This repository has been archived by the owner on Oct 1, 2020. It is now read-only.

Move config from Dockerfile to compose #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 1 addition & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,20 +12,4 @@ WORKDIR /app/hitobito
COPY hitobito/Wagonfile.ci ./Wagonfile
COPY hitobito/Gemfile hitobito/Gemfile.lock ./
RUN gem install --prerelease ruby-debug-ide && gem install debase
RUN bundle install

####################################################################
FROM base as dev

ENV RAILS_ENV=development

ENTRYPOINT [ "/app/.docker/entrypoint" ]
CMD [ "rails", "server", "-b", "0.0.0.0" ]

####################################################################
FROM base as test

ENV RAILS_ENV=test

ENTRYPOINT [ "/app/.docker/entrypoint" ]
CMD [ "rspec" ]
RUN bundle install
23 changes: 11 additions & 12 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
version: '3.4'
services:
app: &app
build:
context: .
target: dev
build: .
depends_on:
- db
- mail
- cache
- worker
env_file: .docker/app.env
environment:
RAILS_ENV: development
entrypoint: "/app/.docker/entrypoint"
ports:
- "3000:3000"
tmpfs: /app/hitobito/tmp/pids
volumes:
- ./:/app
- seed:/seed
command: [ "rails", "server", "-b", "0.0.0.0" ]

worker:
<<: *app
Expand All @@ -27,19 +29,18 @@ services:
- mail
- cache

test: &test
build:
context: .
target: test
test:
<<: *app
depends_on:
- db-test
env_file: .docker/app.env
ports: []
environment:
RAILS_DB_NAME: hitobito_test
RAILS_DB_HOST: db-test
tmpfs: /app/hitobito/tmp/pids
RAILS_ENV: test
volumes:
- ./:/app
command: [ "rspec" ]

app-test:
<<: *test
Expand All @@ -50,9 +51,7 @@ services:
# Dependencies

mail:
build:
context: .
target: base
build: .
command: [ mailcatcher, -f, --ip, '0.0.0.0' ]
ports:
- "1080:1080"
Expand Down