FROM ruby:latest

RUN apt-get update \
    && apt-get install -y --no-install-recommends \
        postgresql-client \
    && apt-get install -y nodejs node \
    && rm -rf /var/lib/apt/lists/*

WORKDIR /app
COPY . /app

RUN bundle install
RUN rake db:migrate db:seed

EXPOSE 3000
CMD rails s -b 0.0.0.0 -p 3000
