FROM ruby:3.3-bookworm

RUN apt-get update -qq && \
    apt-get install -y --no-install-recommends build-essential libpq-dev curl ffmpeg && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /app

ENV BUNDLE_WITHOUT="development:test"
ENV BUNDLE_DEPLOYMENT="1"

COPY Gemfile Gemfile.lock ./
RUN bundle install

COPY . .

EXPOSE 3000

CMD ["bundle", "exec", "puma", "-C", "config/puma.rb", "-b", "tcp://0.0.0.0:3000"]
