# Container Name:: aws-es-proxy
# Copyright (c) 2017 Curse, All Rights Reserved.
#
# Best practices and documentation can be found here:
# https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/
# https://docs.docker.com/engine/reference/builder/

FROM ruby:2

RUN apt-get -y update && \
    apt-get -y --no-install-recommends install openssl ca-certificates dumb-init && \
    apt-get -y autoremove && apt-get clean && \
    rm -rf /var/lib/apt/lists/*

WORKDIR /usr/src/app
ADD Gemfile Gemfile.lock ./
RUN bundle install

ADD proxy.rb ./

ENV UPSTREAM_URL ""
ENV UPSTREAM_SERVICE_NAME "es"
ENV UPSTREAM_REGION "us-west-2"
ENV LISTEN_PORT "9200"

EXPOSE 9200

ENTRYPOINT ["/usr/bin/dumb-init", "--"]
CMD ["bundle", "exec", "./proxy.rb"] 