FROM ecr.clients.internal.justin.tv/alpine-dumb-init:3.8.0-2

# ruby-webrick is included here as it's an unspecified hard dependency of the AWS APIs.
ENV RUNTIME_PACKAGES ruby ruby-bundler ruby-webrick
ENV BUILD_PACKAGES build-base ruby-dev

ADD Gemfile /opt/abaci/Gemfile
ADD Gemfile.lock /opt/abaci/Gemfile.lock

WORKDIR /opt/abaci
RUN apk --no-cache -U add $RUNTIME_PACKAGES $BUILD_PACKAGES && \
    bundler install --without development && \
    apk --no-cache -U del $BUILD_PACKAGES

ADD lib /opt/abaci/lib
ADD abaci /opt/abaci/abaci

CMD ["./abaci"]
