Alpinize Postgres Docker service
This commit is contained in:
parent
b96182dd58
commit
88964e2f7c
@ -22,7 +22,6 @@ if [ ${DEBUG:-0} -eq 1 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Configure Postgres service
|
# Configure Postgres service
|
||||||
cp ${SOURCE_DIR}/lib/systemd/system/postgres.service /lib/systemd/system/postgres.service
|
cp ${SOURCE_DIR}/etc/init.d/postgres /etc/init.d/postgres
|
||||||
systemctl daemon-reload
|
rc-update add postgres boot
|
||||||
systemctl enable postgres
|
service postgres start
|
||||||
systemctl start postgres
|
|
||||||
|
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