Created
August 16, 2021 15:36
-
-
Save brand-it/9420c8f37bc1b0aec849b7d66efc5c40 to your computer and use it in GitHub Desktop.
Rails Template ruby 2.7.3 with nodejs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Choose a version of Ruby | |
FROM ruby:2.7.3-slim | |
ARG APP_NAME=lentille | |
ARG BUNDLER_ARGS | |
ARG BUNDLE_WITH | |
ARG BUNDLE_WITHOUT | |
ARG BUNDLE_DEPLOYMENT | |
ENV APP_NAME=${APP_NAME} | |
ENV INSTALL_PATH=/${APP_NAME} | |
ENV IN_DOCKER=true | |
ENV NODE_VERSION=v14.6.0 | |
ENV BUNDLER_ARGS=${BUNDLER_ARGS} BUNDLE_WITH=${BUNDLE_WITH} BUNDLE_WITHOUT=${BUNDLE_WITHOUT} BUNDLE_DEPLOYMENT=${BUNDLE_DEPLOYMENT} | |
RUN set -x | |
RUN apt-get update -qq | |
RUN apt-get install -qq -y --no-install-recommends wget libpq-dev | |
RUN apt-get clean | |
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man/* | |
WORKDIR $INSTALL_PATH | |
COPY . . | |
RUN wget -qO /tmp/node.tar.gz "https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}-linux-x64.tar.gz" | |
RUN tar -xzf /tmp/node.tar.gz -C /opt/ | |
RUN rm -f /tmp/node.tar.gz | |
RUN gem install bundler && bundle install -j "$(getconf _NPROCESSORS_ONLN)" $BUNDLER_ARGS | |
EXPOSE 3000 | |
RUN ["bin/setup"] | |
CMD ["rails", "server", "-b", "0.0.0.0"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment