postal/ubuntu/Dockerfile
2019-07-14 21:33:45 -04:00

36 lines
1.1 KiB
Docker

FROM ruby:2.6
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 mariadb-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 ${*}", "--"]