FROM ruby:3.3.6
ENV LANG=ja_JP.UTF-8
ENV RUBY_YJIT_ENABLE=1
RUN mkdir /app
WORKDIR /app

RUN gem install bundler
COPY Gemfile /app/Gemfile
COPY Gemfile.lock /app/Gemfile.lock

RUN apt-get update
RUN apt-get install -y build-essential libpq-dev rustc

RUN bundle config set --local without 'development test'
RUN bundle install

COPY . /app
COPY bin/boot.sh /usr/bin/
RUN chmod +x /usr/bin/boot.sh
ENTRYPOINT ["boot.sh"]

EXPOSE 3000
