From 38d134ca09cd934512b201615fb06da01e6e62e2 Mon Sep 17 00:00:00 2001 From: Nat Budin Date: Mon, 11 Sep 2023 10:36:34 -0700 Subject: [PATCH] Gotta make the user before we chown things to it --- Dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 9e273cb0..cdfc21e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -40,13 +40,13 @@ RUN apt-get update -qq && \ apt-get install --no-install-recommends -y libpq5 libmagickcore-6.q16-6 && \ rm -rf /var/lib/apt/lists /var/cache/apt/archives -# Copy built artifacts: gems, application -COPY --from=build /usr/local/bundle /usr/local/bundle -COPY --from=build --chown=rails:rails /rails /rails - # Run and own only the runtime files as a non-root user for security RUN useradd rails --create-home --shell /bin/bash USER rails:rails +# Copy built artifacts: gems, application +COPY --from=build /usr/local/bundle /usr/local/bundle +COPY --from=build --chown=rails:rails /rails /rails + EXPOSE 3000 CMD bundle exec rails server -b 0.0.0.0 -p $PORT