db-status

This commit is contained in:
Mr. Bot 2019-10-17 22:04:59 +03:00
parent 75b363553e
commit 780d4e4ed1
2 changed files with 4 additions and 2 deletions

View File

@ -23,10 +23,10 @@ RUN cd /opt && \
bundle update --all && \ bundle update --all && \
bundle install --deployment --without development:test bundle install --deployment --without development:test
ENTRYPOINT /entrypoint.sh
# Persists copies of other relevant files (DB config, custom themes). Contents of this are copied # Persists copies of other relevant files (DB config, custom themes). Contents of this are copied
# to the relevant places each time the container is started # to the relevant places each time the container is started
VOLUME /opt/staytus/persisted VOLUME /opt/staytus/persisted
EXPOSE 5000 EXPOSE 5000
ENTRYPOINT /entrypoint.sh

View File

@ -2,6 +2,7 @@
: ${DB_USER:=root} : ${DB_USER:=root}
: ${DB_PASSWORD:=root} : ${DB_PASSWORD:=root}
: ${DB_DB_DATABSE:=staytus}
: ${DB_HOST:=127.0.0.1} : ${DB_HOST:=127.0.0.1}
#: ${DB_PORT:=3306} #: ${DB_PORT:=3306}
@ -18,6 +19,7 @@ if [ ! -f /opt/staytus/persisted/config/database.yml ]; then
sed -i "s/username:.*/username: ${DB_USER}/" config/database.yml sed -i "s/username:.*/username: ${DB_USER}/" config/database.yml
sed -i "s|password:.*|password: ${DB_PASSWORD}|" config/database.yml sed -i "s|password:.*|password: ${DB_PASSWORD}|" config/database.yml
sed -i "s|host:.*|host: ${DB_HOST}|" config/database.yml sed -i "s|host:.*|host: ${DB_HOST}|" config/database.yml
sed -i "s|database:.*|database: ${DB_DATABSE}|" config/database.yml
# Copy the config to persist it, and later copy back on each start, to persist this config file # Copy the config to persist it, and later copy back on each start, to persist this config file
# without persisting all of /config (which is mostly app code) # without persisting all of /config (which is mostly app code)