Alpinize Postgres Docker service

This commit is contained in:
Disassembler 2017-12-19 13:53:30 +01:00
parent b96182dd58
commit 88964e2f7c
3 changed files with 19 additions and 15 deletions

View File

@ -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

View 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
}

View File

@ -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