Codewise
Courses
My learning
Ideas
Leaderboard
YouTube
Courses
My learning
Ideas
Leaderboard
YouTube
Sign in
deploy/replica.sh · System Design in Go: Build a Social Network Backend | Codewise
System Design in Go: Build a Social Network Backend
murmur
/
deploy
/
replica.sh
main
replica.sh
7 lines, 241 B
Raw
1
#!/bin/sh
2
# On an empty volume, the replica copies the primary first.
3
set
-e
4
if
[
!
-s
"
$PGDATA
/PG_VERSION"
];
then
5
PGPASSWORD
=
replicator
pg_basebackup
-h
postgres
-U
replicator
-D
"
$PGDATA
"
-S
replica
-R
6
fi
7
exec
docker-entrypoint.sh
"
$@
"