update copying method

This commit is contained in:
ILoveYaToo 2020-12-27 01:15:18 -05:00
parent d894fdbb68
commit 0d69c5d8c4
4 changed files with 13 additions and 6 deletions

View File

@ -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 \ RUN wget https://github.com/wrouesnel/p2cli/releases/download/r5/p2 -O /usr/local/bin/p2 \
&& chmod +x /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 \ && 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 \

View File

@ -5,8 +5,8 @@ rm -rf /opt/postal/tmp/pids/*
rm -rf /tmp/postal rm -rf /tmp/postal
## Check if existing config ## Check if existing config
if [ -f /storage/postal.yml ]; then if [ $(ls /storage | wc -l) > 0 ]; then
cp /storage/postal.yml /opt/postal/config/postal.yml cp /storage/* /opt/postal/config/*
fi fi
## Generate config ## Generate config
@ -25,6 +25,10 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.
/create-user.sh /create-user.sh
## Copy over config to persistent storage ## Copy over config to persistent storage
cp /opt/postal/config/postal.yml /storage/postal.yml 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 else
## Wait for MySQL and RabbitMQ to start up ## Wait for MySQL and RabbitMQ to start up
echo "== Waiting for MySQL and RabbitMQ to start up ==" echo "== Waiting for MySQL and RabbitMQ to start up =="

View File

@ -12,7 +12,6 @@ services:
- "mysql" - "mysql"
- "rabbitmq" - "rabbitmq"
volumes: volumes:
# - ./config/postal.yml:/opt/postal/config/postal.yml
- persistent_assets:/storage - persistent_assets:/storage
- static_assets:/opt/postal/public - static_assets:/opt/postal/public
- postal_assets:/opt/postal/public/assets - postal_assets:/opt/postal/public/assets

View File

@ -5,8 +5,8 @@ rm -rf /opt/postal/tmp/pids/*
rm -rf /tmp/postal rm -rf /tmp/postal
## Check if existing config ## Check if existing config
if [ -f /storage/postal.yml ]; then if [ $(ls /storage | wc -l) > 0 ]; then
cp /storage/postal.yml /opt/postal/config/postal.yml cp /storage/* /opt/postal/config/*
fi fi
## Generate config ## Generate config
@ -25,6 +25,10 @@ if [ ! -f /opt/postal/config/postal.yml ] || [[ $(cat /opt/postal/config/postal.
/create-user.sh /create-user.sh
## Copy over config to persistent storage ## Copy over config to persistent storage
cp /opt/postal/config/postal.yml /storage/postal.yml 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 else
## Wait for MySQL and RabbitMQ to start up ## Wait for MySQL and RabbitMQ to start up
echo "== Waiting for MySQL and RabbitMQ to start up ==" echo "== Waiting for MySQL and RabbitMQ to start up =="