Skip to content

Commit

Permalink
Merge pull request #58 from wvulibraries/main
Browse files Browse the repository at this point in the history
Feb 2 - Mar 22 update
  • Loading branch information
sephirothkod authored Mar 22, 2023
2 parents ccf2132 + e388cbc commit f42dd25
Show file tree
Hide file tree
Showing 34 changed files with 468 additions and 230 deletions.
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
.DS_Store
.DS_Store
/data/
/data/*
/env/
/env*
31 changes: 16 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
FROM ruby:2.7.7

ENV BUNDLER_VERSION=2.2.27
ENV RAILS_VERSION=5.2.6
ENV BUNDLER_VERSION=2.4.7
ENV NODE_VERSION=18
ENV RAILS_VERSION=5.2.8.1
# should match local folder of our application
ENV PROJECT_PATH hydra
ENV TZ="America/New_York"

RUN mkdir -p /home/hydra
WORKDIR /home/hydra
ADD ./hydra /home/hydra
RUN mkdir -p /home/${PROJECT_PATH}/
WORKDIR /home/${PROJECT_PATH}
ADD ./${PROJECT_PATH} /home/${PROJECT_PATH}

RUN apt-get update && apt-get -y install cron
RUN apt-get update && apt-get -y install cron postgresql-client

# Use JEMALLOC instead
# JEMalloc is a faster garbage collection for Ruby.
# -------------------------------------------------------------------------------------------------
RUN apt-get install -y libjemalloc2 libjemalloc-dev
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so
RUN apt-get install -y libjemalloc2
ENV LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.2

RUN \
gem update --system --quiet && \
gem install bundler -v ${BUNDLER_VERSION} && \
gem install rails -v ${RAILS_VERSION} && \
bundle install --jobs=4 --retry=3
bundle install --jobs=4 --retry=3

# Node.js
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - \
&& apt-get install -y nodejs

ADD ./startup.sh /usr/bin/
RUN chmod -v +x /usr/bin/startup.sh
ENTRYPOINT ["/usr/bin/startup.sh"]
# -------------------------------------------------------------------------------------------------
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get -y install nodejs
22 changes: 11 additions & 11 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
FROM ruby:2.7.7

ENV BUNDLER_VERSION=2.2.27
ENV RAILS_VERSION=5.2.6
ENV NODE_VERSION=17
ENV BUNDLE_PATH="/usr/local/bundle"
ENV BUNDLER_VERSION=2.4.7
ENV NODE_VERSION=18
ENV RAILS_VERSION=5.2.8.1
# should match local folder of our application
ENV PROJECT_PATH hydra
ENV TZ="America/New_York"

USER root

RUN mkdir -p /home/hydra
WORKDIR /home/hydra
ADD ./hydra /home/hydra
RUN mkdir -p /home/${PROJECT_PATH}/
WORKDIR /home/${PROJECT_PATH}
ADD ./${PROJECT_PATH} /home/${PROJECT_PATH}

RUN apt-get update && apt-get -y install cron postgresql-client

Expand All @@ -23,9 +23,9 @@ RUN \
gem update --system --quiet && \
gem install bundler -v ${BUNDLER_VERSION} && \
gem install rails -v ${RAILS_VERSION} && \
bundle install --jobs=4 --retry=3
bundle install --jobs=4 --retry=3

# Node.js
# -------------------------------------------------------------------------------------------------
RUN curl -sL https://deb.nodesource.com/setup_${NODE_VERSION}.x | bash - \
&& apt-get install -y nodejs
&& apt-get -y install nodejs
2 changes: 1 addition & 1 deletion conversion/scripts/cron_convert.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

project_name="acda_portal"
project_name="acda_portal_public"

# if automatic export folder present set correct paths
if [ -d "/mnt/nfs-exports/mfcs-exports/${project_name}/export" ]; then
Expand Down
39 changes: 21 additions & 18 deletions docker-compose.dev.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ services:
app:
build:
context: ./
dockerfile: Dockerfile.dev
dockerfile: Dockerfile.dev
env_file:
- './env/.env.dev.hydra'
- './env/.env.dev.local.hydra'
volumes:
- ./hydra:/home/hydra
- ./solr:/home/hydra/solr
- ./solr:/home/hydra/solr
- ./data/logs:/home/hydra/log
- ./scripts:/home/hydra/scripts
- ./mnt:/mnt
- /home/hydra/tmp # don't mount tmp directory
Expand Down Expand Up @@ -68,14 +69,15 @@ services:
networks:
- hydra

fcrepo:
image: ghcr.io/samvera/fcrepo4:4.7.5
container_name: fcrepo
restart: on-failure
volumes:
- fcrepo:/data:cached
ports:
- "8080:8080"
fcrepo:
image: ghcr.io/samvera/fcrepo4:4.7.5
container_name: fcrepo
depends_on:
- db
env_file:
- './env/.env.dev.fedora'
ports:
- "8080:8080"
networks:
- hydra

Expand All @@ -94,6 +96,7 @@ services:
volumes:
- ./solr/conf:/opt/solr/server/configsets/hydraconf
- solr:/var/solr
- ./data/logs/solr_dev/:/var/solr/logs
networks:
- hydra

Expand All @@ -103,15 +106,16 @@ services:
ports:
- "5432"
env_file:
- './env/.env.dev.db'
- './env/.env.dev.local.db'
volumes:
- postgres:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: pg_isready -U postgres -h postgres
interval: 30s
timeout: 3s
retries: 3
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "hyrax"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
networks:
- hydra

Expand All @@ -132,7 +136,6 @@ services:

volumes:
postgres:
fcrepo:
redis:
solr:

Expand Down
41 changes: 23 additions & 18 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ services:
app:
build:
context: ./
dockerfile: Dockerfile.dev
dockerfile: Dockerfile.dev
env_file:
- './env/.env.dev.hydra'
volumes:
- ./hydra:/home/hydra
- ./solr:/home/hydra/solr
- ./solr:/home/hydra/solr
- ./data/logs:/home/hydra/log
- ./scripts:/home/hydra/scripts
- /mnt:/mnt
- /home/hydra/tmp # don't mount tmp directory
Expand Down Expand Up @@ -57,6 +58,8 @@ services:
command: redis-server
ports:
- "6379"
env_file:
- './env/.env.dev.redis'
volumes:
- redis:/var/lib/redis/data
restart: unless-stopped
Expand All @@ -68,16 +71,17 @@ services:
networks:
- hydra

fcrepo:
image: ghcr.io/samvera/fcrepo4:4.7.5
container_name: fcrepo
restart: on-failure
volumes:
- fcrepo:/data:cached
ports:
- "8080:8080"
fcrepo:
image: ghcr.io/samvera/fcrepo4:4.7.5
container_name: fcrepo
depends_on:
- db
env_file:
- './env/.env.dev.fedora'
ports:
- "8080:8080"
networks:
- hydra
- hydra

solr:
image: solr:8.11.1
Expand All @@ -103,15 +107,16 @@ services:
ports:
- "5432"
env_file:
- './env/.env.dev.db'
- './env/.env.dev.local.db'
volumes:
- postgres:/var/lib/postgresql/data
restart: unless-stopped
healthcheck:
test: pg_isready -U postgres -h postgres
interval: 30s
timeout: 3s
retries: 3
healthcheck:
test: ["CMD-SHELL", "pg_isready", "-d", "hyrax"]
interval: 30s
timeout: 60s
retries: 5
start_period: 80s
networks:
- hydra

Expand Down Expand Up @@ -140,4 +145,4 @@ networks:
hydra:
driver: bridge
driver_opts:
com.docker.network.bridge.name: br-hydra
com.docker.network.bridge.name: br-hydra
Loading

0 comments on commit f42dd25

Please sign in to comment.