Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Containerize dor-services-app #179

Merged
merged 1 commit into from Dec 18, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 14 additions & 0 deletions Dockerfile
@@ -0,0 +1,14 @@
FROM ruby:2.5-stretch

RUN apt-get update -qq && \
apt-get install -y nano build-essential libsqlite3-dev nodejs

RUN mkdir /app
WORKDIR /app

COPY Gemfile Gemfile.lock ./
RUN bundle install --without production

COPY . .

CMD puma -C config/puma.rb
19 changes: 19 additions & 0 deletions README.md
Expand Up @@ -52,6 +52,25 @@ To run rubocop separately (auto run with tests):

## Console and Development Server

### Using Docker

First, you'll need both Docker and docker-compose installed.

Run dor-services-app and its dependencies using:

```shell
docker-compose up -d
```

#### Update Docker image

```shell
docker build -t suldlss/dor-services-app:latest .
docker push suldlss/dor-services-app:latest
```

### Without Docker

First you'll need to setup configuration files to connect to a valid Fedora and SOLR instance. See the "config/settings.yml" file for a template. Create a folder called "config/settings" and then copy that settings.yml file and rename it for the environment you wish to setup (e.g. "config/settings/development.local.yml").

Edit this file to add the appropriate URLs. You may also need certs to talk to actual Fedora servers. Once you have this file in place, you can start your Rails server or console in development mode:
Expand Down
9 changes: 9 additions & 0 deletions config/initializers/config.rb
@@ -0,0 +1,9 @@
# frozen_string_literal: true

Config.setup do |config|
config.const_name = 'Settings'
config.use_env = true
config.env_prefix = 'SETTINGS'
config.env_separator = '__'
config.env_converter = nil # don't downcase
end
39 changes: 39 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,39 @@
version: '3.6'

services:
web:
build: .
volumes:
- ./:/app
working_dir: /app
ports:
- 3000:3000
environment:
SOLR_URL: http://solr:8983/solr/dorservices
SETTINGS__SSL__CERT_FILE: /app/spec/support/certs/spec.crt
SETTINGS__SSL__KEY_FILE: /app/spec/support/certs/spec.key
SETTINGS__SSL__KEY_PASS: thisisatleast4bytes
SETTINGS__SOLRIZER_URL: http://solr:8983/solr/dorservices
SETTINGS__FEDORA_URL: http://fedoraAdmin:fedoraAdmin@fcrepo:8080/fedora
SETTINGS__SURI__URL: http://suri:3000
SETTINGS__WORKFLOW_URL: http://workflow:3000

solr:
image: solr:7
volumes:
- ./solr_conf/conf/:/myconfig
command: solr-create -c dorservices -d /myconfig
ports:
- 8984:8983
fcrepo:
image: suldlss/fcrepo:no-messaging-latest
ports:
- 8983:8080
suri:
image: suldlss/suri-rails:latest
ports:
- 3002:3000
workflow:
image: suldlss/workflow-server:latest
ports:
- 3001:3000
31 changes: 31 additions & 0 deletions solr_conf/conf/admin-extra.html
@@ -0,0 +1,31 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- The content of this page will be statically included into the top
of the admin page. Uncomment this as an example to see there the content
will show up.

<hr>
<i>This line will appear before the first table</i>
<tr>
<td colspan="2">
This row will be appended to the end of the first table
</td>
</tr>
<hr>

-->
25 changes: 25 additions & 0 deletions solr_conf/conf/admin-extra.menu-bottom.html
@@ -0,0 +1,25 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- admin-extra.menu-bottom.html -->
<!--
<li>
<a href="#" style="background-image: url(img/ico/construction.png);">
LAST ITEM
</a>
</li>
-->
25 changes: 25 additions & 0 deletions solr_conf/conf/admin-extra.menu-top.html
@@ -0,0 +1,25 @@
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<!-- admin-extra.menu-top.html -->
<!--
<li>
<a href="#" style="background-image: url(img/ico/construction.png);">
FIRST ITEM
</a>
</li>
-->