Skip to content

Commit 5c9031c

Browse files
fix errors in the production rails dockerfile
1 parent ff2186f commit 5c9031c

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

samples/rails/app/Dockerfile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ RUN bundle config set force_ruby_platform true
2828
# Install application gems
2929
COPY Gemfile Gemfile.lock ./
3030
RUN bundle install && \
31-
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git && \
32-
bundle exec bootsnap precompile --gemfile
31+
rm -rf ~/.bundle/ "${BUNDLE_PATH}"/ruby/*/cache "${BUNDLE_PATH}"/ruby/*/bundler/gems/*/.git \
32+
&& bundle exec bootsnap precompile --gemfile
3333

3434
# Copy application code
3535
COPY . .
@@ -45,8 +45,8 @@ RUN SECRET_KEY_BASE_DUMMY=1 ./bin/rails assets:precompile
4545
FROM base
4646

4747
# Install packages needed for deployment
48-
RUN apt-get update -qq && \
49-
apt-get install --no-install-recommends -y curl libvips libpq-dev && \
48+
RUN apt-get update -qq \
49+
&& apt-get install --no-install-recommends -y curl libvips libpq-dev \
5050
&& apt-get clean \
5151
&& rm -rf /var/lib/apt/lists/*
5252

@@ -55,8 +55,8 @@ COPY --from=build /usr/local/bundle /usr/local/bundle
5555
COPY --from=build /rails /rails
5656

5757
# Run and own only the runtime files as a non-root user for security
58-
RUN useradd rails --create-home --shell /bin/bash && \
59-
chown -R rails:rails db log storage tmp
58+
RUN useradd rails --create-home --shell /bin/bash \
59+
&& chown -R rails:rails db log storage tmp
6060
USER rails:rails
6161

6262
# Entrypoint prepares the database.

0 commit comments

Comments
 (0)