Dockerfile-development

Summary

Maintainability
Test Coverage
FROM ruby:3.1.1-alpine3.14 AS Builder

RUN apk add --update --no-cache \
  cmake \
  libcurl \
  tzdata \
  libpq \
  less \
  imagemagick \
  libgcc libstdc++ libx11 glib libxrender libxext libintl \
  libcrypto1.1 libssl1.1 \
  ttf-dejavu ttf-droid ttf-freefont ttf-liberation \
  git \
  postgresql-dev postgresql-client \
  build-base \
  openssl-dev \
  nodejs-current \
  yarn

ARG USERNAME=developer
ARG USER_UID=1000
ARG USER_GID=1000

RUN addgroup --gid $USER_GID $USERNAME &&\
    adduser --shell /bin/bash --disabled-password --uid $USER_UID --ingroup $USERNAME $USERNAME 

RUN chown -R developer:developer /usr/local/bundle

WORKDIR /app

RUN yarn install --check-files

COPY docker/imagemagick-policy.xml /etc/ImageMagick-7/policy.xml

# Caching gems
# https://medium.com/@jfroom/docker-compose-3-bundler-caching-in-dev-9ca1e49ac441
COPY docker/entrypoint.sh /
RUN chmod +x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]