Skip to content

Commit

Permalink
Trying to build the container and then fix the assets
Browse files Browse the repository at this point in the history
  • Loading branch information
louispt1 committed Dec 11, 2024
1 parent 5a1e220 commit 508c362
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 15 deletions.
27 changes: 18 additions & 9 deletions Dockerfile.production
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,30 @@ RUN apt-get update -yqq && \
# Install Bundler
RUN gem install bundler:2.5.18

# Copy Gemfile and install gems
COPY Gemfile* /app/
# Set the working directory
WORKDIR /app

RUN bundle config frozen true \
&& bundle config jobs 4 \
&& bundle config deployment true \
&& bundle config without 'development test' \
&& bundle install
# Copy Gemfile and Gemfile.lock before installing gems
COPY Gemfile Gemfile.lock ./

# Copy application files
# Install production gems only
RUN bundle config set without 'development test' && \
bundle config set deployment 'true' && \
bundle install --jobs 4 --retry 3

# Copy the rest of the application code
COPY . /app/

# Precompile Rails assets (optional; uncomment if needed)
# RUN RAILS_ENV=production DOCKER_BUILD=true bundle exec rails assets:precompile
# Precompile Rails assets
RUN RAILS_ENV=production DOCKER_BUILD=true bundle exec rails assets:precompile
COPY public /app/public

# Set environment to production
ENV RAILS_ENV=production

# Expose the default Rails port
EXPOSE 3000

# Start the application
CMD ["bundle", "exec", "--keep-file-descriptors", "puma", "-C", "config/puma.rb"]
7 changes: 1 addition & 6 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,9 @@ group :development, :test do
gem "factory_bot_rails"
gem 'shoulda-matchers'
gem "rails-controller-testing"
end

group :development do
# Use console on exceptions pages [https://github.com/rails/web-console]
# Use console on exceptions pages [https://github.com/rails/web-console]
gem "web-console"

# Highlight the fine-grained location where an error occurred [https://github.com/ruby/error_highlight]
# gem "error_highlight", ">= 0.6.0", platforms: [:ruby]
end

gem "invisible_captcha", "~> 2.3"

0 comments on commit 508c362

Please sign in to comment.