postal/alpine/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

32 lines
1017 B
Docker

FROM ruby:2.6-rc-alpine
RUN wget https://github.com/wrouesnel/p2cli/releases/download/r5/p2 -O /usr/local/bin/p2 \
&& chmod +x /usr/local/bin/p2
RUN apk --no-cache add nodejs mariadb-client git bash libcap build-base mariadb-dev tzdata mariadb-client-libs \
&& 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 \
&& addgroup -S postal \
&& adduser -S -G postal -h /opt/postal -s /bin/bash postal \
&& chown -R postal:postal /opt/postal/ \
&& /opt/postal/bin/postal bundle /opt/postal/vendor/bundle \
&& apk del git mariadb-dev \
&& rm -rf /var/cache/apk/*
## 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 ${*}", "--"]