Skip to content

Commit

Permalink
misc(docker): Use now ruby-slim instead of alpine (getlago#1435)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdenquin authored Nov 2, 2023
1 parent 998ffa5 commit aa82bcc
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 36 deletions.
30 changes: 8 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,44 +1,30 @@
FROM ruby:3.2.2-alpine as build
FROM ruby:3.2.2-slim as build

WORKDIR /app

COPY ./Gemfile /app/Gemfile
COPY ./Gemfile.lock /app/Gemfile.lock

RUN apk add --no-cache \
git \
bash \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \
tzdata \
openssl \
postgresql-dev \
libc6-compat

ENV BUNDLER_VERSION='2.3.26'
RUN gem install bundler --no-document -v '2.3.26'
RUN apt update -qq && apt install nodejs build-essential git pkg-config libpq-dev -y

ENV BUNDLER_VERSION='2.4.21'
RUN gem install bundler --no-document -v '2.4.21'

RUN bundle config build.nokogiri --use-system-libraries &&\
bundle install --jobs=3 --retry=3 --without development test

FROM ruby:3.2.2-alpine
FROM ruby:3.2.2-slim

WORKDIR /app

COPY . /app

RUN apk add --no-cache \
bash \
postgresql-dev \
tzdata \
libc6-compat

ARG SEGMENT_WRITE_KEY
ARG GOCARDLESS_CLIENT_ID
ARG GOCARDLESS_CLIENT_SECRET

RUN apt update -qq && apt install git libpq-dev -y

ENV SEGMENT_WRITE_KEY $SEGMENT_WRITE_KEY
ENV GOCARDLESS_CLIENT_ID $GOCARDLESS_CLIENT_ID
ENV GOCARDLESS_CLIENT_SECRET $GOCARDLESS_CLIENT_SECRET
Expand Down
18 changes: 4 additions & 14 deletions Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,24 +1,14 @@
FROM ruby:3.2.2-alpine
FROM ruby:3.2.2-slim

WORKDIR /app

COPY ./Gemfile /app/Gemfile
COPY ./Gemfile.lock /app/Gemfile.lock

RUN apk add --no-cache \
git \
bash \
build-base \
libxml2-dev \
libxslt-dev \
nodejs \
tzdata \
postgresql-dev \
openssl \
gcompat
RUN apt update -qq && apt install nodejs build-essential git pkg-config libpq-dev -y

ENV BUNDLER_VERSION='2.3.26'
RUN gem install bundler --no-document -v '2.3.26'
ENV BUNDLER_VERSION='2.4.21'
RUN gem install bundler --no-document -v '2.4.21'

RUN bundle config build.nokogiri --use-system-libraries &&\
bundle install
Expand Down

0 comments on commit aa82bcc

Please sign in to comment.