-
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.
Includes: * Return errors as JSON * Convert controller specs to request specs to catch OpenAPI problems * Switch from sqlite to postgres for the underlying database * Spin up postgres in CI * Add .dockerignore file to keep images svelte * Update Dockerfile * Update README * Re-generate binstubs and add puma binstub * Add docker-compose configuration with web and db services
- Loading branch information
Showing
19 changed files
with
554 additions
and
153 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.git | ||
.dockerignore | ||
.byebug_history | ||
log | ||
tmp | ||
coverage | ||
# Required for puma to have a place to put the pid file | ||
!tmp/pids/.keep |
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 |
---|---|---|
@@ -1,19 +1,27 @@ | ||
FROM ruby:2.7.0-alpine | ||
FROM ruby:2.7.1-alpine | ||
|
||
LABEL maintainer="Stanford Libraries Infrastructure Team <[email protected]>" | ||
|
||
RUN apk update && apk add build-base sqlite-dev tzdata git | ||
RUN apk add --update --no-cache \ | ||
build-base \ | ||
git \ | ||
postgresql-dev \ | ||
postgresql-client \ | ||
libxml2-dev \ | ||
libxslt-dev \ | ||
tzdata | ||
|
||
RUN mkdir /app | ||
WORKDIR /app | ||
|
||
COPY Gemfile Gemfile.lock ./ | ||
RUN gem install bundler -v 2.0.2 | ||
RUN bundle install | ||
RUN gem update --system && \ | ||
gem install bundler && \ | ||
bundle config build.nokogiri --use-system-libraries | ||
|
||
COPY . . | ||
COPY Gemfile Gemfile.lock ./ | ||
|
||
RUN bundle exec rails db:setup | ||
RUN bundle config set without 'production' && bundle install | ||
|
||
LABEL maintainer="Justin Coyne <[email protected]>" | ||
COPY . . | ||
|
||
CMD puma -C config/puma.rb | ||
CMD ["./docker/invoke.sh"] |
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 |
---|---|---|
|
@@ -20,7 +20,7 @@ NOTE: This is currently used for running specs; we still use https://github.com/ | |
|
||
Clone the repository | ||
|
||
$ git clone [email protected]:sul-dlss/suri_rails.git | ||
$ git clone [email protected]:sul-dlss/suri-rails.git | ||
|
||
Change directories into the app and install dependencies | ||
|
||
|
@@ -32,27 +32,35 @@ Start the development server | |
|
||
## Testing | ||
|
||
First, ensure the database container is spun up: | ||
|
||
$ docker-compose up db # use -d to daemonize/run in background | ||
|
||
And if you haven't yet prepared the test database, run: | ||
|
||
$ bin/rails db:setup | ||
|
||
The test suite (with RuboCop style enforcement) will be run with the default rake task (also run on CI). | ||
|
||
$ rake | ||
$ bin/rake | ||
|
||
The specs can be run without RuboCop enforcement | ||
|
||
$ rake spec | ||
$ bin/rake spec | ||
|
||
The RuboCop style enforcement can be run without running the tests | ||
|
||
$ rake rubocop | ||
$ bin/rake rubocop | ||
|
||
## Building for Docker | ||
|
||
```shell | ||
$ docker build -t suldlss/suri-rails:latest . | ||
``` | ||
Spin up the application and its database: | ||
|
||
$ docker-compose up --build | ||
|
||
## Updating Docker Image | ||
|
||
Then run as: | ||
```shell | ||
$ docker run -d -p 127.0.0.1:3002:3000 suldlss/suri-rails:latest | ||
``` | ||
Note that CI is configured to automatically update the image hosted on DockerHub on every commit to `master`. If you want to build and push an image manually, run: | ||
|
||
Note that CI is configured to automatically update the image hosted on DockerHub on every commit to `master`. | ||
$ docker build -t suldlss/suri-rails:latest . | ||
$ docker push suldlss/suri-rails:latest |
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
Oops, something went wrong.