diff --git a/cmd/audiusd/entrypoint.sh b/cmd/audiusd/entrypoint.sh old mode 100644 new mode 100755 index 2ff8927667c..77ecf48753e --- a/cmd/audiusd/entrypoint.sh +++ b/cmd/audiusd/entrypoint.sh @@ -37,13 +37,15 @@ export uptimeDataDir=${uptimeDataDir:-/data/bolt} export audius_core_root_dir=${audius_core_root_dir:-/data/audiusd} export creatorNodeEndpoint=${creatorNodeEndpoint:-http://localhost} -if [ ! -d "$POSTGRES_DATA_DIR" ] || [ -z "$(ls -A "$POSTGRES_DATA_DIR")" ]; then +if [ ! -d "$POSTGRES_DATA_DIR" ] || [ -z "$(ls -A "$POSTGRES_DATA_DIR" 2>/dev/null)" ]; then echo "Initializing PostgreSQL data directory at $POSTGRES_DATA_DIR..." su - postgres -c "/usr/lib/postgresql/*/bin/initdb -D $POSTGRES_DATA_DIR" echo "Updating PostgreSQL configuration for password authentication..." sed -i "s/peer/trust/g" "$POSTGRES_DATA_DIR/pg_hba.conf" sed -i "s/md5/trust/g" "$POSTGRES_DATA_DIR/pg_hba.conf" +else + echo "PostgreSQL data directory already initialized at $POSTGRES_DATA_DIR." fi chown -R postgres:postgres "$POSTGRES_DATA_DIR" diff --git a/pkg/orchestration/docker.go b/pkg/orchestration/docker.go index 84e65e9407c..70c12d1a482 100644 --- a/pkg/orchestration/docker.go +++ b/pkg/orchestration/docker.go @@ -414,36 +414,42 @@ func runNodeWrapperless( } hostConfig := &container.HostConfig{ Mounts: []mount.Mount{ - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/mediorum", Target: "/tmp/mediorum", }, - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/creator-node-backend", Target: "/file_storage", }, - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/creator-node-db-15", Target: "/var/lib/postgresql/data", }, - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/bolt", Target: "/bolt", }, - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/bolt", Target: "/audius-core", }, - mount.Mount{ + { Type: mount.TypeBind, Source: "/var/k8s/env", Target: "/env", }, + // allow me to work on entrypoint without building the image + { + Type: mount.TypeBind, + Source: "/private/var/orion/audius/audius-protocol/cmd/audiusd/entrypoint.sh", + Target: "/bin/entrypoint.sh", + }, }, } @@ -567,10 +573,10 @@ func runNodeWrapperless( } } - logger.Info("Creating auto-update cron job") - if err := setAutoUpdateCron(host, config.Version, nconf.DeployOn); err != nil { - return logger.Error("Failed to add auto-update cron job:", err) - } + // logger.Info("Creating auto-update cron job") + // if err := setAutoUpdateCron(host, config.Version, nconf.DeployOn); err != nil { + // return logger.Error("Failed to add auto-update cron job:", err) + // } return nil }