FROM ruby:__RUBY_VERSION__
RUN apt-get update && apt-get install -y git curl build-essential libpq-dev nodejs npm && rm -rf /var/lib/apt/lists/*
WORKDIR /app
ARG DISCOURSE_VERSION=stable
RUN git clone --depth 1 --branch ${DISCOURSE_VERSION} https://github.com/discourse/discourse .
RUN gem install bundler && bundle install
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod +x /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
