During startup make postgres owner of PGDATA dir if not already.

Refs #51
remotes/origin/no-uploadlimit-63
Stefan Verhoeven 6 years ago
parent da676bc583
commit c9a98f6ae5

@ -70,9 +70,6 @@ docker create --name cartodb_pgdata sverhoeven/cartodb
# Change to directory to save the Postgresql data dir (cartodb_pgdata) of the CartoDB image
docker cp cartodb_pgdata:/var/lib/postgresql $PWD/cartodb_pgdata
docker rm -f cartodb_pgdata
# Inside container cartodb_pgdata is owned by postgres (uid=103) user,
# it should be owned by same user on the local filesystem
sudo chown -R 103.103 $PWD/cartodb_pgdata
```
After this the CartoDB container will have a database that stays filled after restarts.

@ -4,6 +4,13 @@ export CARTO_HOSTNAME=${CARTO_HOSTNAME:=$HOSTNAME}
perl -pi -e 's/cartodb\.localhost/$ENV{"CARTO_HOSTNAME"}/g' /etc/nginx/sites-enabled/default /cartodb/config/app_config.yml /Windshaft-cartodb/config/environments/development.js
PGDATA=/var/lib/postgresql
if [ "$(stat -c %U $PGDATA)" != "postgres" ]; then
(>&2 echo "${PGDATA} not owned by postgres, updating permissions")
chown -R postgres $PGDATA
chmod 700 $PGDATA
fi
service postgresql start
service redis-server start
/opt/varnish/sbin/varnishd -a :6081 -T localhost:6082 -s malloc,256m -f /etc/varnish.vcl

Loading…
Cancel
Save