Skip to content

Commit

Permalink
Try to optimize image size
Browse files Browse the repository at this point in the history
  • Loading branch information
chrztoph committed Nov 29, 2023
1 parent cfad2de commit 9cdb398
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,12 @@ ENV RAILS_ENV=$RAILS_ENV_ARG
ENV RAILS_ROOT /var/www/texterify

# Install essential libraries.
RUN apt-get update && apt-get install -y build-essential libpq-dev
RUN apt-get update && apt-get install -y build-essential libpq-dev curl apt-transport-https yarn && apt-get -y autoclean

# Set workdir.
RUN mkdir -p $RAILS_ROOT
WORKDIR $RAILS_ROOT

# Install gems.
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN gem install bundler:2.1.4
RUN bundle install --jobs 20 --retry 5 --without development test

# Update the repository sources list
# and install dependencies.
RUN apt-get update \
&& apt-get install -y curl \
&& apt-get -y autoclean

# Install nvm.
ENV NVM_DIR /usr/local/nvm
RUN mkdir -p $NVM_DIR
Expand All @@ -47,10 +35,14 @@ ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH

# Install yarn.
RUN apt-get install apt-transport-https
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn -y

# Install gems.
COPY Gemfile Gemfile
COPY Gemfile.lock Gemfile.lock
RUN gem install bundler:2.1.4
RUN bundle install --jobs 20 --retry 5 --without development test

# Copy project files.
COPY . .
Expand Down

0 comments on commit 9cdb398

Please sign in to comment.