test to see if this fixes the issue
This commit is contained in:
parent
2dbca14548
commit
5df19e5051
|
@ -5,7 +5,7 @@ ENV DOCKERIZE_VERSION v0.6.1
|
|||
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-connector-c openssl \
|
||||
RUN apk --no-cache add nodejs mariadb-client git bash libcap build-base mariadb-dev tzdata mariadb-connector-c openssl expect\
|
||||
&& git clone https://github.com/atech/postal.git /opt/postal \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& gem install bundler \
|
||||
|
@ -28,6 +28,7 @@ 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/create-user.sh /create-user.sh
|
||||
ADD src/templates /templates
|
||||
|
||||
## Expose
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
version: "3"
|
||||
services:
|
||||
postal:
|
||||
image: catdeployed/postal:alpine
|
||||
#image: catdeployed/postal:alpine
|
||||
build: .
|
||||
container_name: postal
|
||||
command: run
|
||||
ports:
|
||||
|
@ -10,7 +11,7 @@ services:
|
|||
- "mysql"
|
||||
- "rabbitmq"
|
||||
volumes:
|
||||
- ./config/postal.yml:/opt/postal/config/postal.yml
|
||||
- persistent_assets:/storage
|
||||
- static_assets:/opt/postal/public
|
||||
- postal_assets:/opt/postal/public/assets
|
||||
- ./src/templates/:/templates
|
||||
|
@ -61,3 +62,4 @@ volumes:
|
|||
static_assets:
|
||||
postal_assets:
|
||||
mysql_data:
|
||||
persistent_assets:
|
||||
|
|
11
alpine/src/create-user.sh
Executable file
11
alpine/src/create-user.sh
Executable file
|
@ -0,0 +1,11 @@
|
|||
#!/usr/bin/expect
|
||||
eval spawn /opt/postal/bin/postal make-user
|
||||
expect "E-Mail"
|
||||
send "$env(POSTAL_EMAIL)\n"
|
||||
expect "First Name"
|
||||
send "$env(POSTAL_FNAME)\n"
|
||||
expect "Last Name"
|
||||
send "$env(POSTAL_LNAME)\n"
|
||||
expect "Password"
|
||||
send "$env(POSTAL_PASSWORD)\n"
|
||||
interact
|
|
@ -4,6 +4,11 @@
|
|||
rm -rf /opt/postal/tmp/pids/*
|
||||
rm -rf /tmp/postal
|
||||
|
||||
## Check if existing config
|
||||
if [ -f /storage/postal.yml ]; then
|
||||
cp /storage/postal.yml /opt/postal/config/postal.yml
|
||||
fi
|
||||
|
||||
## Generate config
|
||||
if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then
|
||||
## Build Jinja2 Template
|
||||
|
@ -15,18 +20,15 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.
|
|||
/opt/postal/bin/postal initialize-config
|
||||
## Wait for MySQL and RabbitMQ to start up
|
||||
echo "== Waiting for MySQL and RabbitMQ to start up =="
|
||||
dockerize -wait tcp://mysql:3306 -wait http://rabbitmq:5672/api/aliveness-test
|
||||
dockerize -timeout 60m -wait tcp://mysql:3306 -wait tcp://rabbitmq:5672
|
||||
/opt/postal/bin/postal initialize
|
||||
/opt/postal/bin/postal make-user <<-EOF
|
||||
$POSTAL_EMAIL
|
||||
$POSTAL_FNAME
|
||||
$POSTAL_LNAME
|
||||
$POSTAL_PASSWORD
|
||||
EOF
|
||||
/create-user.sh
|
||||
## Copy over config to persistent storage
|
||||
cp /opt/postal/config/postal.yml /storage/postal.yml
|
||||
else
|
||||
## Wait for MySQL and RabbitMQ to start up
|
||||
echo "== Waiting for MySQL and RabbitMQ to start up =="
|
||||
dockerize -wait tcp://mysql:3306 -wait http://rabbitmq:5672/api/aliveness-test
|
||||
dockerize -timeout 60m -wait tcp://mysql:3306 -wait tcp://rabbitmq:5672
|
||||
fi
|
||||
## Start Postal
|
||||
/opt/postal/bin/postal "$@"
|
||||
|
|
|
@ -9,7 +9,7 @@ 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 wget \
|
||||
&& apt-get -y install --no-install-recommends nodejs mariadb-client git-core libcap2-bin wget expect\
|
||||
&& git clone https://github.com/atech/postal.git /opt/postal \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& gem install bundler \
|
||||
|
@ -32,6 +32,7 @@ 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/create-user.sh /create-user.sh
|
||||
ADD src/templates /templates
|
||||
|
||||
## Expose
|
||||
|
|
|
@ -1,16 +1,19 @@
|
|||
version: "3"
|
||||
services:
|
||||
postal:
|
||||
image: catdeployed/postal:ubuntu
|
||||
#image: catdeployed/postal:ubuntu
|
||||
build: .
|
||||
container_name: postal
|
||||
command: run
|
||||
tty: true
|
||||
ports:
|
||||
- 127.0.0.1:25:25
|
||||
depends_on:
|
||||
- "mysql"
|
||||
- "rabbitmq"
|
||||
volumes:
|
||||
- ./config/postal.yml:/opt/postal/config/postal.yml
|
||||
# - ./config/postal.yml:/opt/postal/config/postal.yml
|
||||
- persistent_assets:/storage
|
||||
- static_assets:/opt/postal/public
|
||||
- postal_assets:/opt/postal/public/assets
|
||||
- ./src/templates/:/templates
|
||||
|
@ -58,6 +61,7 @@ services:
|
|||
- static_assets:/opt/postal/public:ro
|
||||
- postal_assets:/opt/postal/public/assets:ro
|
||||
volumes:
|
||||
persistent_assets:
|
||||
static_assets:
|
||||
postal_assets:
|
||||
mysql_data:
|
||||
|
|
|
@ -4,6 +4,11 @@
|
|||
rm -rf /opt/postal/tmp/pids/*
|
||||
rm -rf /tmp/postal
|
||||
|
||||
## Check if existing config
|
||||
if [ -f /storage/postal.yml ]; then
|
||||
cp /storage/postal.yml /opt/postal/config/postal.yml
|
||||
fi
|
||||
|
||||
## Generate config
|
||||
if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.yml | wc -l) < 2 ]]; then
|
||||
## Build Jinja2 Template
|
||||
|
@ -15,18 +20,15 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.
|
|||
/opt/postal/bin/postal initialize-config
|
||||
## Wait for MySQL and RabbitMQ to start up
|
||||
echo "== Waiting for MySQL and RabbitMQ to start up =="
|
||||
dockerize -wait tcp://mysql:3306 -wait http://rabbitmq:5672/api/aliveness-test
|
||||
dockerize -timeout 60m -wait tcp://mysql:3306 -wait tcp://rabbitmq:5672
|
||||
/opt/postal/bin/postal initialize
|
||||
/opt/postal/bin/postal make-user <<-EOF
|
||||
$POSTAL_EMAIL
|
||||
$POSTAL_FNAME
|
||||
$POSTAL_LNAME
|
||||
$POSTAL_PASSWORD
|
||||
EOF
|
||||
/create-user.sh
|
||||
## Copy over config to persistent storage
|
||||
cp /opt/postal/config/postal.yml /storage/postal.yml
|
||||
else
|
||||
## Wait for MySQL and RabbitMQ to start up
|
||||
echo "== Waiting for MySQL and RabbitMQ to start up =="
|
||||
dockerize -wait tcp://mysql:3306 -wait http://rabbitmq:5672/api/aliveness-test
|
||||
dockerize -timeout 60m -wait tcp://mysql:3306 -wait tcp://rabbitmq:5672
|
||||
fi
|
||||
## Start Postal
|
||||
/opt/postal/bin/postal "$@"
|
||||
|
|
Loading…
Reference in New Issue
Block a user