Skip to content

Instantly share code, notes, and snippets.

@amitk
Created December 24, 2022 19:27
Show Gist options
  • Save amitk/602a40f1be162b612a1ebb88f387dc79 to your computer and use it in GitHub Desktop.
Save amitk/602a40f1be162b612a1ebb88f387dc79 to your computer and use it in GitHub Desktop.
Docker file to create a rails application with ruby slim image
FROM ruby:3.1.1-slim
WORKDIR /usr/src/app
RUN apt-get update && \
apt-get install ruby-full build-essential -y && \
apt-get install libpq-dev -y
COPY . .
RUN gem update --system
RUN bundle install
RUN if [ -f tmp/pids/server.pid ]; then rm tmp/pids/server.pid; fi
EXPOSE 3000
ENTRYPOINT ["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