Retrospring/.docker/ruby/Dockerfile

50 lines
1.1 KiB
Docker
Raw Normal View History

2020-04-19 05:59:50 -07:00
FROM ruby:2.7
2020-04-18 16:17:37 -07:00
USER root
ARG UID=1000
ARG GID=1000
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
2020-05-09 01:16:30 -07:00
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash -
2020-04-18 16:17:37 -07:00
RUN apt-get update -qq \
&& apt-get install -y --no-install-recommends build-essential \
libpq-dev postgresql-client \
2020-05-09 01:16:30 -07:00
libxml2-dev libxslt1-dev \
libmagickwand-dev imagemagick \
libidn11-dev \
nodejs \
yarn \
&& rm -rf /var/lib/apt/lists/*
2020-04-18 16:17:37 -07:00
RUN mkdir /app \
&& mkdir /cache
2020-05-09 01:16:30 -07:00
WORKDIR /app
2020-04-18 16:17:37 -07:00
RUN addgroup --gid ${GID} app \
&& adduser --gecos "" --disabled-password --shell /bin/bash --uid ${UID} --gid ${GID} app \
&& chown "${UID}:${GID}" -R /app/ \
&& chown "${UID}:${GID}" -R /cache/
COPY .docker/entrypoint.sh /usr/bin/
RUN chmod +x /usr/bin/entrypoint.sh
USER app:app
2020-05-09 01:16:30 -07:00
ADD Gemfile* /app/
RUN bundle install --jobs=$(nproc)
2020-10-20 02:47:00 -07:00
RUN gem install ruby-debug-ide
ADD package.json /app/
ADD yarn.lock /app/
RUN yarn install
2020-05-09 01:16:30 -07:00
COPY . /app
2020-04-18 16:17:37 -07:00
2020-05-09 01:16:30 -07:00
ENTRYPOINT ["entrypoint.sh"]
2020-04-19 05:59:50 -07:00
EXPOSE 3000
2020-05-09 01:16:30 -07:00
CMD ["rails", "server", "-b", "0.0.0.0"]