From bf8804bf1acb660407163628bab8b41379831cf5 Mon Sep 17 00:00:00 2001 From: Justin Coyne Date: Tue, 28 Nov 2023 13:56:17 -0600 Subject: [PATCH] Make a docker image for testing sul-embed --- Dockerfile | 28 ++++++++++++++++++++++++++++ docker-compose.yml | 12 ++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..f48d598b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +ARG RUBY_VERSION=3.2.2-alpine +FROM ruby:$RUBY_VERSION + +RUN apk add --update --no-cache \ + build-base \ + git \ + tzdata + +WORKDIR /app + +ENV RAILS_ENV="production" \ + BUNDLER_WITHOUT="development test" \ + RAILS_SERVE_STATIC_FILES="true" + +COPY Gemfile Gemfile.lock ./ + +RUN bundle install + +COPY . . + +# Precompile bootsnap code for faster boot times +RUN bundle exec bootsnap precompile --gemfile app/ lib/ + +# Precompiling assets for production without requiring secret RAILS_MASTER_KEY +RUN SECRET_KEY_BASE_DUMMY=1 bundle exec rails assets:precompile + +EXPOSE 3000 +CMD ["./bin/rails", "server"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..21f2f9cf --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,12 @@ +version: '3.6' + +services: + web: + build: . + ports: + - 3001:3000 + environment: + SECRET_KEY_BASE: '1' + RAILS_LOG_TO_STDOUT: 'true' + REMOTE_USER: blalbrit@stanford.edu + tty: true \ No newline at end of file