diff --git a/Dockerfile b/Dockerfile index 71bc93b07..70a3429c1 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,14 @@ -FROM ghcr.io/scientist-softserv/dev-ops/samvera:e9200061 as hyku-base +ARG RUBY_VERSION=2.7.6 +FROM ruby:$RUBY_VERSION-alpine3.15 as builder + +RUN apk add build-base +RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.2.1/jemalloc-5.2.1.tar.bz2 | tar -xj && \ + cd jemalloc-5.2.1 && \ + ./configure && \ + make && \ + make install + +FROM ghcr.io/scientist-softserv/dev-ops/samvera:f71b284f as hyku-base COPY --chown=1001:101 $APP_PATH/Gemfile* /app/samvera/hyrax-webapp/ RUN sh -l -c " \ @@ -18,6 +28,8 @@ RUN ln -sf /app/samvera/branding /app/samvera/hyrax-webapp/public/branding CMD ./bin/web +COPY --from=builder /usr/local/lib/libjemalloc.so.2 /usr/local/lib/ +ENV LD_PRELOAD=/usr/local/lib/libjemalloc.so.2 + FROM hyku-base as hyku-worker -ENV MALLOC_ARENA_MAX=2 -CMD ./bin/worker \ No newline at end of file +CMD ./bin/worker diff --git a/docker-compose.yml b/docker-compose.yml index bd20ada95..e092b3599 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,7 @@ x-app: &app target: hyku-base args: - EXTRA_APK_PACKAGES=less vim bash openjdk11-jre ffmpeg rsync exiftool + - HYKU_BULKRAX_ENABLED=true image: ghcr.io/scientist-softserv/palni-palci:${TAG:-latest} env_file: - .env @@ -41,7 +42,6 @@ services: - 2181:2181 - 7001:7000 environment: - - ALLOW_ANONYMOUS_LOGIN=yes - ZOO_MY_ID=1 - ZOO_SERVERS=server.1=zoo:2888:3888;2181 - ZOO_4LW_COMMANDS_WHITELIST=mntr,srvr,ruok,conf @@ -83,11 +83,11 @@ services: networks: internal: healthcheck: - test: curl -sf http://$$SOLR_ADMIN_USER:$$SOLR_ADMIN_PASSWORD@solr:8983/solr/admin/cores?action=STATUS || exit 1 - start_period: 3s - interval: 5s + test: curl -sf http://$$SOLR_ADMIN_USER:$$SOLR_ADMIN_PASSWORD@localhost:8983/solr/admin/cores?action=STATUS || exit 1 + start_period: 30s + interval: 20s timeout: 5s - retries: 6 + retries: 3 depends_on: zoo: condition: service_healthy @@ -124,8 +124,7 @@ services: web: <<: *app - # Uncomment command to access container with out starting Rails. Useful for debugging - # command: sleep infinity + # command: sh -l -c "bundle && bundle exec puma -v -b tcp://0.0.0.0:3000" environment: - VIRTUAL_PORT=3000 - VIRTUAL_HOST=.hyku.test @@ -160,6 +159,7 @@ services: target: hyku-worker args: - EXTRA_APK_PACKAGES=less vim bash openjdk11-jre ffmpeg rsync exiftool + - HYKU_BULKRAX_ENABLED=true cache_from: - ghcr.io/scientist-softserv/palni-palci:${TAG:-latest} - ghcr.io/scientist-softserv/palni-palci/worker:${TAG:-latest} @@ -246,4 +246,4 @@ services: - "4443:4443" - "4444:4444" networks: - internal: \ No newline at end of file + internal: