fix merge

This commit is contained in:
CatDeployed 2018-09-02 20:59:38 -04:00
commit 1072504477
7 changed files with 35 additions and 21 deletions

View File

@ -1,12 +1,12 @@
#### Alpine Linux Container (Default) #### Alpine Linux Container (Default)
![](https://images.microbadger.com/badges/image/catdeployed/postal:alpine.svg) ![](https://img.shields.io/microbadger/layers/catdeployed/postal/alpine.svg) [![](https://images.microbadger.com/badges/image/catdeployed/postal:alpine.svg)](https://hub.docker.com/r/catdeployed/postal/) [![](https://img.shields.io/microbadger/layers/catdeployed/postal/alpine.svg)](https://hub.docker.com/r/catdeployed/postal/)
For this container, use the 'alpine' folder. For this container, use the 'alpine' folder.
#### Ubuntu Linux Container #### Ubuntu Linux Container
![](https://images.microbadger.com/badges/image/catdeployed/postal:ubuntu.svg) ![](https://img.shields.io/microbadger/layers/catdeployed/postal/ubuntu.svg) [![](https://images.microbadger.com/badges/image/catdeployed/postal:ubuntu.svg)](https://hub.docker.com/r/catdeployed/postal/) [![](https://img.shields.io/microbadger/layers/catdeployed/postal/ubuntu.svg)](https://hub.docker.com/r/catdeployed/postal/)
For this container, use the 'ubuntu' folder For this container, use the 'ubuntu' folder.
### Instructions ### Instructions
Change configuration in docker-compose.yml to update passwords for MySQL/RabbitMQ. Note that both passwords in the `postal` service, `mysql` service and `rabbitmq` service have to be changed to the same values. Change configuration in docker-compose.yml to update passwords for MySQL/RabbitMQ. Note that both passwords in the `postal` service, `mysql` service and `rabbitmq` service have to be changed to the same values.
@ -36,3 +36,12 @@ Port mappings may change (as they have in the past). If SMTP/HTTP(s) is not work
### Anti-Spam / Antivirus ### Anti-Spam / Antivirus
The initial design for the container was to be simple, minimal, and customizable, so Spamassassin and ClamAV are not included by default. Feel free to fork and add to the Dockerfile (though you must set docker-compose.yml to build from Dockerfile and not pull an image), or add them by linking additional containers. The initial design for the container was to be simple, minimal, and customizable, so Spamassassin and ClamAV are not included by default. Feel free to fork and add to the Dockerfile (though you must set docker-compose.yml to build from Dockerfile and not pull an image), or add them by linking additional containers.
### Updates
- v2.0.0
* Update to more reliable version of YAML management system
* Split into ubuntu and alpine images
* Moved to CircleCI for more advanced building
- v1.0.0
* Initial Release

View File

@ -1,7 +1,9 @@
FROM ruby:2.5-alpine FROM ruby:2.6-rc-alpine
RUN apk --no-cache add nodejs mariadb-client git bash python2 libcap py-setuptools py-pip build-base mariadb-dev tzdata mariadb-client-libs \ RUN wget https://github.com/wrouesnel/p2cli/releases/download/r5/p2 -O /usr/local/bin/p2 \
&& pip install j2cli \ && 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 \ && git clone https://github.com/atech/postal.git /opt/postal \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& gem install bundler \ && gem install bundler \
@ -25,4 +27,5 @@ ADD src/templates /templates
EXPOSE 5000 EXPOSE 5000
## Startup ## Startup
# ENV RUBYOPT --jit
ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"] ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"]

View File

@ -3,7 +3,7 @@
## Generate config ## Generate config
if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then
## Build Jinja2 Template ## Build Jinja2 Template
j2 /templates/postal.example.yml.j2 > /opt/postal/config/postal.example.yml p2 -t /templates/postal.example.yml.j2 -o /opt/postal/config/postal.example.yml
## Add in secret key building ## Add in secret key building
echo "rails:" >> /opt/postal/config/postal.example.yml echo "rails:" >> /opt/postal/config/postal.example.yml
echo " secret_key: {{secretkey}}" >> /opt/postal/config/postal.example.yml echo " secret_key: {{secretkey}}" >> /opt/postal/config/postal.example.yml

View File

@ -1,17 +1,15 @@
server { server {
listen 80; listen 80;
root /opt/postal/public; root /opt/postal/public;
gzip_static on;
gzip_proxied any;
location / { location / {
client_max_body_size 50M; client_max_body_size 50M;
try_files $uri $uri/index.html $uri.html @puma; try_files $uri $uri/index.html $uri.html @puma;
} }
location /assets { location /assets {
add_header Cache-Control max-age=3600; add_header Cache-Control "public,max-age=3600,immutable";
} }
location @puma { location @puma {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;

View File

@ -1,8 +1,13 @@
FROM ruby:2.4 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 \ RUN apt-get -y update \
&& apt-get -y install --no-install-recommends nodejs mysql-client git-core python-minimal python-pip python-dev libcap2-bin python-setuptools \ && apt-get -y install --no-install-recommends nodejs mysql-client git-core libcap2-bin \
&& pip install j2cli \
&& git clone https://github.com/atech/postal.git /opt/postal \ && git clone https://github.com/atech/postal.git /opt/postal \
&& rm -rf /var/lib/apt/lists/* \ && rm -rf /var/lib/apt/lists/* \
&& gem install bundler \ && gem install bundler \
@ -26,4 +31,5 @@ ADD src/templates /templates
EXPOSE 5000 EXPOSE 5000
## Startup ## Startup
# ENV RUBYOPT --jit
ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"] ENTRYPOINT ["/bin/bash", "-c", "/docker-entrypoint.sh ${*}", "--"]

View File

@ -3,7 +3,7 @@
## Generate config ## Generate config
if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then
## Build Jinja2 Template ## Build Jinja2 Template
j2 /templates/postal.example.yml.j2 > /opt/postal/config/postal.example.yml p2 -t /templates/postal.example.yml.j2 -o /opt/postal/config/postal.example.yml
## Add in secret key building ## Add in secret key building
echo "rails:" >> /opt/postal/config/postal.example.yml echo "rails:" >> /opt/postal/config/postal.example.yml
echo " secret_key: {{secretkey}}" >> /opt/postal/config/postal.example.yml echo " secret_key: {{secretkey}}" >> /opt/postal/config/postal.example.yml

View File

@ -1,17 +1,15 @@
server { server {
listen 80; listen 80;
root /opt/postal/public; root /opt/postal/public;
gzip_static on;
gzip_proxied any;
location / { location / {
client_max_body_size 50M; client_max_body_size 50M;
try_files $uri $uri/index.html $uri.html @puma; try_files $uri $uri/index.html $uri.html @puma;
} }
location /assets { location /assets {
add_header Cache-Control max-age=3600; add_header Cache-Control "public,max-age=3600,immutable";
} }
location @puma { location @puma {
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host; proxy_set_header Host $host;