-
Notifications
You must be signed in to change notification settings - Fork 5
/
pod-compose.sh
executable file
·50 lines (39 loc) · 1.14 KB
/
pod-compose.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
set -o allexport
source .env
if [ ! -d "$HOME/data_server/results" ] ; then
mkdir "$HOME/data_server/results" -p
fi
# assign first argument to data server image, otherwise use default
data_server_img=${1:-"quay.io/openshift-scale/snappy-data-server:2"}
podman rm -f pg_svc snap_web script
podman volume rm pgvol
podman pod rm snappy
podman volume create pgvol
podman pod create --name=snappy --publish $DATA_SERVER_PORT:$DATA_SERVER_PORT
podman run \
--detach \
--env-file=.env \
--name=pg_svc \
--pod=snappy \
--volume pgvol:/var/lib/postgresql/data \
postgres:13.1-alpine
podman run \
--detach \
--name script \
--env POSTGRES_PORT=5432 \
--env POSTGRES_SERVER=localhost \
--env-file=.env \
--pod=snappy \
--rm \
$data_server_img sh scripts/prestart.sh
podman run \
--detach \
--env POSTGRES_PORT=5432 \
--env POSTGRES_SERVER=localhost \
--env-file=.env \
--name=snap_web \
--pod=snappy \
--volume "$HOME/data_server/results:/data_server/app/app/results:z" \
--volume "$PWD/pruner_config.toml:/data_server/app/pruner_config.toml:z" \
$data_server_img