-
Notifications
You must be signed in to change notification settings - Fork 43
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 #77 from osingaatje/docker-setup
Add docker setup for more consistent testing
- Loading branch information
Showing
10 changed files
with
80 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FROM ruby:3.2.2 | ||
|
||
WORKDIR /app | ||
|
||
ADD . /app | ||
|
||
# Install nodejs | ||
RUN apt-get update -qq && apt-get install -y nodejs postgresql-client \ | ||
&& apt-get clean | ||
|
||
# Update bundler to correct version | ||
RUN gem install bundler:2.4.3 | ||
|
||
# Install any needed packages | ||
RUN bundle install |
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
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,11 @@ | ||
#!/usr/bin/env sh | ||
set -e | ||
|
||
# go to dummy app (where the bundle and rake files are) | ||
cd ./spec/apps/dummy | ||
echo "== Creating fresh database... ==" | ||
bundle exec rake db:reset | ||
cd ../../.. # nagivate back to root of project | ||
|
||
echo "== Running tests... ==" | ||
bundle exec rspec |
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,26 @@ | ||
version: '2.3' | ||
services: | ||
postgresql: | ||
image: postgres:15 | ||
ports: | ||
- 5432 | ||
environment: | ||
- POSTGRES_PASSWORD=Sup3rSecr1tPasw8rd | ||
- POSTGRES_USER=postgres | ||
- PGDATA=/var/lib/postgresql/data/pgdata | ||
volumes: | ||
- postgresql:/var/lib/postgresql/data | ||
|
||
test: | ||
build: ./ | ||
volumes: | ||
- .:/app | ||
depends_on: | ||
- postgresql | ||
command: 'bin/test' | ||
environment: | ||
- RAILS_ENV=test | ||
- DATABASE_URL=postgresql://postgres:Sup3rSecr1tPasw8rd@postgresql:5432/scimitar-test | ||
|
||
volumes: | ||
postgresql: |
Empty file.
Empty file.
Empty file.
Empty file.