Skip to content

Commit

Permalink
deploying, #7
Browse files Browse the repository at this point in the history
  • Loading branch information
trinitytakei committed Sep 4, 2024
1 parent b0e2843 commit 03d3850
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ RUN apt-get update -qq && \

# Set production environment
ENV RAILS_ENV="production" \
BUNDLE_WITHOUT="development:test" \
BUNDLE_DEPLOYMENT="1" \
BUNDLE_PATH="/usr/local/bundle" \
BUNDLE_WITHOUT="development"
BUNDLE_PATH="/usr/local/bundle"

# Throw-away build stage to reduce size of final image
FROM base AS build
Expand All @@ -49,16 +49,19 @@ RUN apt-get update && apt-get install -y ca-certificates curl gnupg && \
# Verify Node.js and Yarn installation
RUN node --version && yarn --version

# Install application gems
COPY Gemfile Gemfile.lock ./
RUN bundle config set --local build.nokogiri --use-system-libraries && \
bundle install --jobs 4 --retry 3 && \
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git

# Install node modules
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Copy application code
COPY . .

RUN bundle config set --local build.nokogiri --use-system-libraries
RUN bundle install --jobs 4 --retry 3

# Final stage for app image
FROM base

Expand Down

0 comments on commit 03d3850

Please sign in to comment.