Created
April 26, 2020 01:11
-
-
Save Yardboy/48f31a255723f8489cebec4c783b858f to your computer and use it in GitHub Desktop.
dockerfile
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
FROM ruby:2.6.5 | |
LABEL app-name="shards" | |
RUN apt-get update -qq && apt-get install -y \ | |
nodejs \ | |
curl \ | |
vim | |
# Create and set the working directory | |
ENV APP_HOME /app | |
RUN mkdir $APP_HOME | |
WORKDIR $APP_HOME | |
# Add RAILS/RACK/NODE ENV vars for env dependent tasks | |
ARG RAILS_ENV | |
ENV RAILS_ENV $RAILS_ENV | |
ARG RACK_ENV | |
ENV RACK_ENV $RACK_ENV | |
ARG NODE_ENV | |
ENV NODE_ENV $NODE_ENV | |
# Install Yarn and update PATH for executable | |
ENV YARN_VERSION=1.22.4 | |
RUN curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version $YARN_VERSION | |
ENV PATH="/root/.yarn/bin:${PATH}" | |
# Install ruby dependencies | |
ENV BUNDLE_PATH /bundle | |
ADD Gemfile* $APP_HOME/ | |
RUN bundle config --global silence_root_warning 1 | |
RUN bundle install | |
# Install node dependencies | |
ADD package.json yarn.lock $APP_HOME/ | |
RUN yarn install --force | |
# COPY app to container | |
COPY . $APP_HOME | |
# Expose puma port | |
EXPOSE 3000 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment