Created
July 1, 2021 00:17
-
-
Save kaiomagalhaes/3af3023e0d61e391dc3b695461343f41 to your computer and use it in GitHub Desktop.
Rails API dockerfile
This file contains hidden or 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: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