From 8ec75d6f176a52cdfbe36e2e5c4e33b1d6cbfe61 Mon Sep 17 00:00:00 2001 From: zhouyu Date: Thu, 5 Dec 2024 15:01:13 -0800 Subject: [PATCH] clr Dockfile --- Dockerfile | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/Dockerfile b/Dockerfile index ab280ee..ffb9165 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,7 +23,6 @@ RUN mkdir -p /opt/app \ # Get list of available packages RUN apt-get update -qq - # Install standard packages from the Debian repository RUN apt-get update && apt-get install -y --no-install-recommends \ bash \ @@ -45,7 +44,7 @@ RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \ && apt-get clean && rm -rf /var/lib/apt/lists/* # By default, run as the geodata user -USER geodata +USER $APP_USER # All subsequent commands run relative to the app directory. WORKDIR /opt/app @@ -53,14 +52,12 @@ WORKDIR /opt/app # Add binstubs to the path. ENV PATH="/opt/app/bin:$PATH" - # If run with no other arguments, the image will start the rails server by # default. Note that we must bind to all interfaces (0.0.0.0) because when # running in a docker container, the actual public interface is created # dynamically at runtime (we don't know its address in advance). CMD ["rails", "server", "-b", "0.0.0.0", "--pid", "/tmp/puma.pid"] - # ============================================================================ # Target: development # Installs all dependencies, requiring the (large) build-base package. Build @@ -77,7 +74,7 @@ RUN apt-get install -y --no-install-recommends \ make # Drop back to the GeoData user -USER geodata +USER $APP_USER # Copy over only the files which are needed to perform a bundle install. COPY --chown=geodata .ruby-version Gemfile* ./ @@ -101,7 +98,6 @@ FROM base AS production COPY --from=development --chown=geodata /opt/app /opt/app COPY --from=development --chown=geodata /usr/local/bundle /usr/local/bundle - # Sanity-check that the bundle is correctly installed, that the Gemfile # and Gemfile.lock are synced, and that assets are able to be compiled. # no need to run bundle install