2019-01-31 04:55:57 +01:00
|
|
|
FROM ruby:2.6
|
2020-04-18 22:08:00 +02:00
|
|
|
|
2020-04-18 21:38:38 +02:00
|
|
|
ENV DOCKERIZE_VERSION v0.6.1
|
2018-08-27 02:49:44 +02:00
|
|
|
|
|
|
|
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
|
2017-04-26 22:35:49 +02:00
|
|
|
|
2018-08-02 04:45:32 +02:00
|
|
|
RUN apt-get -y update \
|
2020-04-18 21:38:38 +02:00
|
|
|
&& apt-get -y install --no-install-recommends nodejs mariadb-client git-core libcap2-bin wget \
|
2018-05-27 01:42:52 +02:00
|
|
|
&& git clone https://github.com/atech/postal.git /opt/postal \
|
2017-09-12 05:01:31 +02:00
|
|
|
&& rm -rf /var/lib/apt/lists/* \
|
|
|
|
&& gem install bundler \
|
|
|
|
&& gem install procodile \
|
2018-08-03 03:53:27 +02:00
|
|
|
&& gem install tzinfo-data \
|
2018-08-02 04:45:32 +02:00
|
|
|
&& useradd -r -d /opt/postal -s /bin/bash postal \
|
2017-09-12 05:01:31 +02:00
|
|
|
&& chown -R postal:postal /opt/postal/ \
|
2018-05-27 23:40:25 +02:00
|
|
|
&& /opt/postal/bin/postal bundle /opt/postal/vendor/bundle \
|
2018-08-02 04:45:32 +02:00
|
|
|
&& apt-get -y purge python-dev git-core \
|
|
|
|
&& apt-get -y autoremove \
|
|
|
|
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
2018-05-27 01:42:52 +02:00
|
|
|
|
2020-04-18 22:08:00 +02:00
|
|
|
## Install jwilder/dockerize
|
2020-04-18 21:38:38 +02:00
|
|
|
RUN wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
|
|
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
|
|
|
|
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz
|
|
|
|
|
2018-05-27 01:42:52 +02:00
|
|
|
## Adjust permissions
|
|
|
|
RUN setcap 'cap_net_bind_service=+ep' /usr/local/bin/ruby
|
2017-04-27 11:38:13 +02:00
|
|
|
|
2017-05-06 04:31:47 +02:00
|
|
|
## Stick in required files
|
2018-05-27 01:42:52 +02:00
|
|
|
ADD src/docker-entrypoint.sh /docker-entrypoint.sh
|
|
|
|
ADD src/templates /templates
|
2017-04-26 22:38:01 +02:00
|
|
|
|
2017-04-27 10:48:51 +02:00
|
|
|
## Expose
|
|
|
|
EXPOSE 5000
|
|
|
|
|
2017-04-27 09:50:07 +02:00
|
|
|
## Startup
|
2018-08-27 02:49:44 +02:00
|
|
|
# ENV RUBYOPT --jit
|
2018-05-27 01:42:52 +02:00
|
|
|
ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"]
|