Skip to content

Instantly share code, notes, and snippets.

@kaiomagalhaes
Created July 1, 2021 00:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kaiomagalhaes/3af3023e0d61e391dc3b695461343f41 to your computer and use it in GitHub Desktop.
Save kaiomagalhaes/3af3023e0d61e391dc3b695461343f41 to your computer and use it in GitHub Desktop.
Rails API dockerfile
FROM ruby:3.0.1-buster
ARG ENVIRONMENT
ARG SECRET_KEY_BASE
RUN echo "Running Dockerfile with the environment: ${ENVIRONMENT}"
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle config set with ${ENVIRONMENT}
RUN bundle install
EXPOSE 3000
COPY . .
ENV RAILS_ENV ${ENVIRONMENT}
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