commit 5ab38a2a72aa7a895de4c62ab647f450e7be8270 Author: ALinuxNinja Date: Wed Apr 26 16:35:49 2017 -0400 Initial Commit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8af62f8 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +FROM ruby:2.4 + +## Install augeas +RUN apt-get -y update \ +&& apt-get -y install augeas-lenses augeas-tools nodejs + +## Install required gems +RUN gem install bundler && gem install procodile + +## Create user for postal +RUN useradd -r -m -d /opt/postal -s /bin/bash postal + +## Clone postal +RUN git clone https://github.com/atech/postal /opt/postal/app \ +&& chown -R postal:postal /opt/postal/ + +## Install gems required by postal +RUN /opt/postal/app/bin/postal bundle /opt/postal/app/vendor/bundle + +## Clean up apt +RUN rm -rf /var/lib/apt/lists/* diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..19a0943 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,6 @@ +version: "3" +services: + postal: + build: . + image: postal + container_name: postal diff --git a/scripts/start.sh b/scripts/start.sh new file mode 100644 index 0000000..1c1d75b --- /dev/null +++ b/scripts/start.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +## Generate keys if they do not exist +if [[ ! -f /opt/postal/config/signing.key ]]; then + /opt/postal/app/bin/postal initialize-config +fi + +## Use augeas to set the MySQL/RabbitMQ setup + +## Run