FROM debian:jessie

MAINTAINER herloct <herloct@gmail.com>

RUN apt-get update
RUN apt-get install -y openjdk-7-jre-headless ruby unzip curl

RUN useradd -ms /bin/bash sencha
RUN cd && cp -R .bashrc .profile /home/sencha

RUN mkdir -p /home/sencha/app
ADD . /home/sencha/app

RUN chown -R sencha:sencha /home/sencha

USER sencha
ENV HOME /home/sencha

RUN curl -o /home/sencha/cmd.sh.zip http://cdn.sencha.com/cmd/6.1.3/no-jre/SenchaCmd-6.1.3-linux-amd64.sh.zip
RUN unzip -p /home/sencha/cmd.sh.zip > /home/sencha/cmd-install.sh && \
    chmod +x /home/sencha/cmd-install.sh && \
    /home/sencha/cmd-install.sh -q && \
    rm /home/sencha/cmd*

WORKDIR /home/sencha/app

EXPOSE 1841

ENTRYPOINT ["/home/sencha/bin/Sencha/Cmd/6.1.3.42/sencha"]
CMD ["help"]

FROM debian:jessie

MAINTAINER herloct <herloct@gmail.com>

RUN apt-get update && \
    apt-get install -y \
        curl \
        openjdk-7-jre-headless \
        ruby \
        unzip

RUN useradd -m sencha && \
    cd && cp -R .bashrc .profile /home/sencha && \
    mkdir -p /project && \
    chown -R sencha:sencha /home/sencha /project

USER sencha
ENV HOME /home/sencha

RUN curl -o /home/sencha/cmd.sh.zip http://cdn.sencha.com/cmd/6.1.3/no-jre/SenchaCmd-6.1.3-linux-amd64.sh.zip && \
    unzip -p /home/sencha/cmd.sh.zip > /home/sencha/cmd-install.sh && \
    chmod +x /home/sencha/cmd-install.sh && \
    /home/sencha/cmd-install.sh -q && \
    rm /home/sencha/cmd*

ENV PATH /home/sencha/bin/Sencha/Cmd/6.1.3.42/:$PATH

VOLUME /project
WORKDIR /project

EXPOSE 1841

ENTRYPOINT ["sencha"]
CMD ["help"]

Simplify layers, use `/project` instead of `/home/sencha/app`, use VOLUME instead of ADD
Simplify layers, use `/project` instead of `/home/sencha/app`, use VOLUME instead of ADD
