Skip to content

Commit

Permalink
Merge pull request #1052 from sul-dlss/docker
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo authored Nov 29, 2023
2 parents 215ef56 + 82b6188 commit eeaa66b
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
version: '3.6'

services:
web:
build: .
ports:
- 3001:3000
environment:
SECRET_KEY_BASE: 'e55fb68eb0f1f4f82fbb56eafeebf1c134518fd466d1c3d01b2bfd3d6b5cd9347b4c15eecb3bdc0e4c5bc226dba626a23bb7b9ddb14f709638571f910002f639'
RAILS_LOG_TO_STDOUT: 'true'
REMOTE_USER: [email protected]
SETTINGS__CORS__ALLOW_ORIGIN_URL: 'http://localhost:3000'
tty: true

0 comments on commit eeaa66b

Please sign in to comment.