Skip to content

Commit 1ef5127

Browse files
committed
chore: improve scripts by stopping existing container if exists
1 parent 70b5cbe commit 1ef5127

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

docker-run-published.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/usr/bin/env bash
22

3-
# This script just runs the latest published image and does not build it locally.
4-
5-
docker pull ghcr.io/payloadcms/postgis-vector:latest && docker run --rm \
3+
docker pull ghcr.io/payloadcms/postgis-vector:latest && \
4+
# Stop existing container if it exists
5+
docker rm -f postgis-vector || true && \
6+
# Run new container
7+
docker run --rm \
8+
--name postgis-vector \
69
-e POSTGRES_USER=devuser \
710
-e POSTGRES_PASSWORD=devpassword \
811
-e POSTGRES_DB=mydb \
912
-e PAYLOAD_DATABASE=postgres \
1013
-p 5433:5432 \
11-
ghcr.io/payloadcms/postgis-vector:latest
14+
ghcr.io/payloadcms/postgis-vector:latest

docker-run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
#!/usr/bin/env bash
22

3+
# Stop existing container if it exists
4+
docker rm -f pgvectortest || true && \
5+
# Run new container
36
docker run --rm \
7+
--name pgvectortest \
48
-e POSTGRES_USER=devuser \
59
-e POSTGRES_PASSWORD=devpassword \
610
-e POSTGRES_DB=mydb \

0 commit comments

Comments
 (0)