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

Commit

Permalink
Docker support added for warclight. (#224)
Browse files Browse the repository at this point in the history
  • Loading branch information
obrienben authored Aug 11, 2021
1 parent e0f0d1e commit 222eafc
Show file tree
Hide file tree
Showing 4 changed files with 76 additions and 0 deletions.
39 changes: 39 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
ARG ALPINE_RUBY_VERSION=3.14

FROM ruby:alpine${ALPINE_RUBY_VERSION}

RUN apk add --update --no-cache \
bash \
build-base \
git \
libxml2-dev \
libxslt-dev \
nodejs \
yarn \
shared-mime-info \
sqlite-dev \
tzdata

RUN mkdir /app
WORKDIR /app

RUN gem update --system && \
gem install bundler && \
bundle config build.nokogiri --use-system-libraries

RUN gem install rails

COPY template.rb .

RUN rails new warclight -m template.rb

WORKDIR /app/warclight

COPY docker-entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/docker-entrypoint.sh
ENTRYPOINT ["docker-entrypoint.sh"]

EXPOSE 3000

CMD ["rails", "server", "-b", "0.0.0.0"]

11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,17 @@ Then visit [http://localhost:3000](http://localhost:3000). It will also start a

You can also run `bin/console` for an interactive prompt that will allow you to experiment.

### Run with docker

Ensure Docker is installed and configured.

```sh
$ docker-compose build
$ docker-compose up
```

Then visit [http://localhost:3000](http://localhost:3000). It will also start a Solr instance on port 8983.

### Release a new version of the gem

To release a new version:
Expand Down
21 changes: 21 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: "3.7"

services:
app:
build:
context: .
dockerfile: Dockerfile
args:
- ALPINE_RUBY_VERSION=3.14
depends_on:
- solr
ports:
- "3000:3000"
environment:
- SOLR_URL='http://solr:8983/solr/discovery'
- RAILS_VERSION= 5.2.4.1

solr:
image: ukwa/webarchive-discovery-solr
ports:
- "8983:8983"
5 changes: 5 additions & 0 deletions docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/env bash
set -e

rm -f /app/.internal_test_app/tmp/pids/server.pid
exec "$@"

0 comments on commit 222eafc

Please sign in to comment.