postal/ubuntu/Dockerfile
Denis Denisov 0d01b1cee6 ruby v2.6-rc, j2cli drop-in replacement by p2cli
* j2cli replaced by p2cli (https://github.com/wrouesnel/p2cli).
  - Python is removed, not needed.
* Ruby 2.6-rc (Alpine & Ubuntu).
2018-08-27 04:25:22 +03:00

36 lines
1.1 KiB
Docker

FROM ruby:2.6-rc
RUN curl -L https://github.com/wrouesnel/p2cli/releases/download/r5/p2 -o /usr/local/bin/p2 \
&& chmod +x /usr/local/bin/p2
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - \
&& apt-get install -y nodejs
RUN apt-get -y update \
&& apt-get -y install --no-install-recommends nodejs mysql-client git-core libcap2-bin \
&& git clone https://github.com/atech/postal.git /opt/postal \
&& rm -rf /var/lib/apt/lists/* \
&& gem install bundler \
&& gem install procodile \
&& gem install tzinfo-data \
&& useradd -r -d /opt/postal -s /bin/bash postal \
&& chown -R postal:postal /opt/postal/ \
&& /opt/postal/bin/postal bundle /opt/postal/vendor/bundle \
&& apt-get -y purge python-dev git-core \
&& apt-get -y autoremove \
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
## Adjust permissions
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby
## Stick in required files
ADD src/docker-entrypoint.sh /docker-entrypoint.sh
ADD src/templates /templates
## Expose
EXPOSE 5000
## Startup
# ENV RUBYOPT --jit
ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"]