awesome-compose/rails-postgres/app/Dockerfile
Alex Koch bbad983a6e
Add sample rails + postgresql application
Signed-off-by: Alex Koch <alex@esparklearning.com>
2022-09-16 11:05:27 -05:00

19 lines
319 B
Docker

FROM ruby:3.1
WORKDIR /app
RUN useradd -m app && chown app:app /app
RUN apt-get update -qq && apt-get install -y --no-install-recommends postgresql-client
USER app
COPY --chown=app:app Gemfile* .
RUN bundle install
COPY --chown=app:app . .
EXPOSE 3000
CMD ["bundle", "exec", "rails", "server", "-b", "0.0.0.0"]