From 0d69c5d8c46b35ec05026f9935679a3b07005b90 Mon Sep 17 00:00:00 2001 From: ILoveYaToo Date: Sun, 27 Dec 2020 01:15:18 -0500 Subject: [PATCH] update copying method --- alpine/Dockerfile | 2 +- alpine/src/docker-entrypoint.sh | 8 ++++++-- ubuntu/docker-compose.yml | 1 - ubuntu/src/docker-entrypoint.sh | 8 ++++++-- 4 files changed, 13 insertions(+), 6 deletions(-) diff --git a/alpine/Dockerfile b/alpine/Dockerfile index e02bf2f..9c3e641 100644 --- a/alpine/Dockerfile +++ b/alpine/Dockerfile @@ -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 expect\ +RUN apk --no-cache add nodejs mariadb-client git bash libcap build-base mariadb-dev tzdata mariadb-connector-c openssl expect curl\ && git clone https://github.com/atech/postal.git /opt/postal \ && rm -rf /var/lib/apt/lists/* \ && gem install bundler \ diff --git a/alpine/src/docker-entrypoint.sh b/alpine/src/docker-entrypoint.sh index 648c9a8..e35992e 100755 --- a/alpine/src/docker-entrypoint.sh +++ b/alpine/src/docker-entrypoint.sh @@ -5,8 +5,8 @@ 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 +if [ $(ls /storage | wc -l) > 0 ]; then + cp /storage/* /opt/postal/config/* fi ## Generate config @@ -25,6 +25,10 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal. /create-user.sh ## Copy over config to persistent storage cp /opt/postal/config/postal.yml /storage/postal.yml + cp /opt/postal/config/fast_server.cert /storage/fast_server.cert + cp /opt/postal/config/fast_server.key /storage/fast_server.key + cp /opt/postal/config/lets_encrypt.pem /storage/lets_encrypt.pem + cp /opt/postal/config/signing.key /storage/signing.key else ## Wait for MySQL and RabbitMQ to start up echo "== Waiting for MySQL and RabbitMQ to start up ==" diff --git a/ubuntu/docker-compose.yml b/ubuntu/docker-compose.yml index 1b94645..d6c4c33 100644 --- a/ubuntu/docker-compose.yml +++ b/ubuntu/docker-compose.yml @@ -12,7 +12,6 @@ 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 diff --git a/ubuntu/src/docker-entrypoint.sh b/ubuntu/src/docker-entrypoint.sh index 648c9a8..e35992e 100755 --- a/ubuntu/src/docker-entrypoint.sh +++ b/ubuntu/src/docker-entrypoint.sh @@ -5,8 +5,8 @@ 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 +if [ $(ls /storage | wc -l) > 0 ]; then + cp /storage/* /opt/postal/config/* fi ## Generate config @@ -25,6 +25,10 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal. /create-user.sh ## Copy over config to persistent storage cp /opt/postal/config/postal.yml /storage/postal.yml + cp /opt/postal/config/fast_server.cert /storage/fast_server.cert + cp /opt/postal/config/fast_server.key /storage/fast_server.key + cp /opt/postal/config/lets_encrypt.pem /storage/lets_encrypt.pem + cp /opt/postal/config/signing.key /storage/signing.key else ## Wait for MySQL and RabbitMQ to start up echo "== Waiting for MySQL and RabbitMQ to start up =="