-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
9 changed files
with
207 additions
and
3 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,56 @@ | ||
# This dockerfile is based on the production dockerfile, minus GYR Efiler Java deps | ||
|
||
### First build stage used for web, worker, and shakapacker containers | ||
FROM ruby:3.2.2 AS base | ||
|
||
RUN apt-get update --allow-releaseinfo-change | ||
|
||
# System prerequisites | ||
RUN apt-get update \ | ||
&& apt-get -y install ca-certificates libgnutls30 build-essential libpq-dev ghostscript default-jre poppler-utils curl \ | ||
&& curl -sL https://deb.nodesource.com/setup_16.x | bash - \ | ||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ | ||
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \ | ||
&& apt-get update && apt-get install -y nodejs yarn python3 python3-pip python3-setuptools \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
ENV SUPERCRONIC_URL=https://github.com/aptible/supercronic/releases/download/v0.1.9/supercronic-linux-amd64 \ | ||
SUPERCRONIC=supercronic-linux-amd64 \ | ||
SUPERCRONIC_SHA1SUM=5ddf8ea26b56d4a7ff6faecdd8966610d5cb9d85 | ||
|
||
RUN curl -fsSLO "$SUPERCRONIC_URL" \ | ||
&& echo "${SUPERCRONIC_SHA1SUM} ${SUPERCRONIC}" | sha1sum -c - \ | ||
&& chmod +x "$SUPERCRONIC" \ | ||
&& mv "$SUPERCRONIC" "/usr/local/bin/${SUPERCRONIC}" \ | ||
&& ln -s "/usr/local/bin/${SUPERCRONIC}" /usr/local/bin/supercronic | ||
|
||
ADD ./vendor/pdftk /app/vendor/pdftk | ||
RUN /app/vendor/pdftk/install | ||
|
||
WORKDIR /app | ||
ADD package.json yarn.lock /app/ | ||
RUN NODE_ENV=production yarn install --frozen-lockfile | ||
ADD .ruby-version Gemfile Gemfile.lock /app/ | ||
|
||
RUN gem install bundler:$(cat Gemfile.lock | tail -1 | tr -d " ") --no-document \ | ||
&& bundle install | ||
|
||
RUN echo "IRB.conf[:USE_AUTOCOMPLETE] = false" > ./.irbrc | ||
|
||
# Install the OpenCV headless library | ||
RUN pip3 install opencv-python-headless --break-system-packages | ||
|
||
# https://github.com/jwilder/dockerize | ||
ENV DOCKERIZE_VERSION=v0.7.0 | ||
RUN wget -O - https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz | tar xzf - -C /usr/local/bin | ||
|
||
ADD . /app | ||
|
||
### This build stage is used for the rails app only | ||
FROM base AS app | ||
|
||
EXPOSE 3000 | ||
|
||
RUN chmod +x /app/bin/docker-entrypoint | ||
|
||
CMD ["bash", "./bin/docker-entrypoint"] |
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,15 @@ | ||
#!/bin/sh | ||
|
||
dockerize -wait tcp://db:5432 -timeout 20s -wait-retry-interval 10s bash -c "bin/rails db:create" | ||
bin/rails db:prepare | ||
bin/rails parallel:create | ||
bin/rails parallel:prepare | ||
bin/rails db:seed | ||
|
||
bundle exec rake assets:precompile | ||
|
||
if [ -f /app/tmp/pids/server.pid ]; then | ||
rm /app/tmp/pids/server.pid | ||
fi | ||
|
||
bundle exec rails s -b 0.0.0.0 -p 3000 |
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,85 @@ | ||
name: vita-min | ||
|
||
services: | ||
db: | ||
container_name: db | ||
image: postgis/postgis:13-3.4-alpine | ||
user: postgres | ||
ports: | ||
- 5432:5432 | ||
volumes: | ||
- database:/var/lib/postgresql/data | ||
environment: | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: password | ||
worker: | ||
container_name: worker | ||
volumes: | ||
- ./:/app | ||
build: | ||
dockerfile: Dockerfile.local | ||
target: "base" | ||
command: rails jobs:work | ||
depends_on: | ||
web: | ||
condition: service_healthy | ||
environment: | ||
- DOCKER=true | ||
- RAILS_DB_HOST=db | ||
- RAILS_DB_USERNAME=postgres | ||
- RAILS_DB_PORT=5432 | ||
- RAILS_DB_PASSWORD=password | ||
web: | ||
container_name: web | ||
build: | ||
dockerfile: Dockerfile.local | ||
target: "app" | ||
volumes: | ||
- ./:/app | ||
ports: | ||
- 3000:3000 | ||
depends_on: | ||
- db | ||
- shakapacker | ||
links: | ||
- db | ||
- shakapacker | ||
healthcheck: | ||
test: [ "CMD", "curl", "-f", "http://0.0.0.0:3000/up" ] | ||
interval: 30s | ||
timeout: 30s | ||
retries: 15 | ||
environment: | ||
- DOCKER=true | ||
- RAILS_DB_HOST=db | ||
- RAILS_DB_USERNAME=postgres | ||
- RAILS_DB_PORT=5432 | ||
- RAILS_DB_PASSWORD=password | ||
- SHAKAPACKER_DEV_SERVER_HOST=shakapacker | ||
shakapacker: | ||
container_name: shakapacker | ||
build: | ||
dockerfile: Dockerfile.local | ||
target: "base" | ||
volumes: | ||
- ./:/app | ||
ports: | ||
- 3035:3035 | ||
command: "bin/shakapacker-dev-server --client-web-socket-url auto://0.0.0.0:3035/ws" | ||
environment: | ||
- SHAKAPACKER_DEV_SERVER_HOST=shakapacker | ||
chrome: | ||
container_name: chrome | ||
image: selenium/standalone-chrome:4.15.0 # this version should match that of the selenium-webdriver gem (see Gemfile) | ||
ports: | ||
- 4444:4444 | ||
pgadmin: | ||
container_name: pgadmin | ||
profiles: ["pgadmin"] | ||
image: chorss/docker-pgadmin4 | ||
ports: | ||
- 5050:5050 | ||
depends_on: | ||
- web | ||
volumes: | ||
database: |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
require 'webmock/rspec' | ||
|
||
WebMock.disable_net_connect!(allow_localhost: true) | ||
if ENV['DOCKER'] | ||
WebMock.allow_net_connect! | ||
else | ||
WebMock.disable_net_connect!(allow_localhost: true) | ||
end |