diff --git a/staytus/Dockerfile b/staytus/Dockerfile index 225332bd5..cfd9ba5cb 100644 --- a/staytus/Dockerfile +++ b/staytus/Dockerfile @@ -23,10 +23,10 @@ RUN cd /opt && \ bundle update --all && \ bundle install --deployment --without development:test -ENTRYPOINT /entrypoint.sh - # 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 VOLUME /opt/staytus/persisted EXPOSE 5000 + +ENTRYPOINT /entrypoint.sh \ No newline at end of file diff --git a/staytus/entrypoint.sh b/staytus/entrypoint.sh index 1753ddb92..04254360f 100755 --- a/staytus/entrypoint.sh +++ b/staytus/entrypoint.sh @@ -2,6 +2,7 @@ : ${DB_USER:=root} : ${DB_PASSWORD:=root} +: ${DB_DB_DATABSE:=staytus} : ${DB_HOST:=127.0.0.1} #: ${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|password:.*|password: ${DB_PASSWORD}|" 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 # without persisting all of /config (which is mostly app code)