Alpinize Postgres Docker service
This commit is contained in:
parent
b96182dd58
commit
88964e2f7c
@ -22,7 +22,6 @@ if [ ${DEBUG:-0} -eq 1 ]; then
|
||||
fi
|
||||
|
||||
# Configure Postgres service
|
||||
cp ${SOURCE_DIR}/lib/systemd/system/postgres.service /lib/systemd/system/postgres.service
|
||||
systemctl daemon-reload
|
||||
systemctl enable postgres
|
||||
systemctl start postgres
|
||||
cp ${SOURCE_DIR}/etc/init.d/postgres /etc/init.d/postgres
|
||||
rc-update add postgres boot
|
||||
service postgres start
|
||||
|
16
postgres/etc/init.d/postgres
Normal file
16
postgres/etc/init.d/postgres
Normal file
@ -0,0 +1,16 @@
|
||||
#!/sbin/openrc-run
|
||||
|
||||
description="Postgres docker container"
|
||||
|
||||
depend() {
|
||||
need docker net
|
||||
use dns logger netmount
|
||||
}
|
||||
|
||||
start() {
|
||||
/usr/bin/docker run --rm --name postgres -v /srv/postgres:/var/lib/postgresql postgres
|
||||
}
|
||||
|
||||
stop() {
|
||||
/usr/bin/docker stop postgres
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
[Unit]
|
||||
Description=PostgreSQL + PostGIS Docker container
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=simple
|
||||
ExecStart=/usr/bin/docker run --rm --name postgres -v /srv/postgres:/var/lib/postgresql postgres
|
||||
ExecStop=/usr/bin/docker stop postgres
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
Loading…
Reference in New Issue
Block a user