Skip to content

Commit

Permalink
clr Dockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhoubk committed Dec 5, 2024
1 parent 956925d commit 8ec75d6
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -45,22 +44,20 @@ 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

# 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
Expand All @@ -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* ./
Expand All @@ -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
Expand Down

0 comments on commit 8ec75d6

Please sign in to comment.