2024-08-28 12:51:25 +00:00
|
|
|
POD=mirrormanager2
|
|
|
|
|
2024-08-29 23:13:29 +00:00
|
|
|
podman pod exists $POD || podman pod create -p 5000:5000 -n $POD
|
2024-08-28 12:51:25 +00:00
|
|
|
|
2024-12-20 17:30:23 +00:00
|
|
|
podman container exists postgres || podman run --pod $POD \
|
|
|
|
--name postgres \
|
|
|
|
--replace -d \
|
|
|
|
-e POSTGRES_PASSWORD=mirrormanager \
|
|
|
|
-e POSTGRES_DB=mirrormanager \
|
|
|
|
-v pgdata:/var/lib/postgresql/data \
|
|
|
|
docker.io/library/postgres:15
|
|
|
|
|
2024-08-28 12:51:25 +00:00
|
|
|
test -d tmp || mkdir tmp
|
|
|
|
test -f client_secrets.json || (echo "missing client_secrets" && exit 2)
|
|
|
|
|
2024-12-20 17:30:23 +00:00
|
|
|
#podman build -t git.resf.org/infrastructure/mirrormanager2:dev -f Containerfile
|
2024-08-29 23:13:29 +00:00
|
|
|
podman rm --force mm2 -t 1
|
2024-08-28 12:51:25 +00:00
|
|
|
podman run \
|
|
|
|
--pod $POD \
|
|
|
|
--name mm2 \
|
|
|
|
--replace \
|
|
|
|
-e 'MM2_CONFIG=/etc/mirrormanager/mirrormanager2.cfg' \
|
2024-08-29 23:13:29 +00:00
|
|
|
-e "MM2_SECRET_KEY=$(openssl rand -hex 32)" \
|
|
|
|
-e "MM2_PASSWORD_SEED=$(openssl rand -hex 32)" \
|
2024-12-20 17:30:23 +00:00
|
|
|
-e 'MM2_SQLALCHEMY_DATABASE_URI=postgresql://postgres:mirrormanager@postgres:5432/mirrormanager' \
|
2024-08-29 23:13:29 +00:00
|
|
|
-e 'MM2_THEME_FOLDER=rocky' \
|
2024-08-30 19:34:13 +00:00
|
|
|
-e 'FLASK_DEBUG=1' \
|
|
|
|
-e 'MM2_DEBUG=1' \
|
2024-08-30 19:35:47 +00:00
|
|
|
-v $PWD/mirrormanager2.cfg:/etc/mirrormanager/mirrormanager2.cfg:z,ro \
|
|
|
|
-v $PWD/client_secrets.json:/etc/mirrormanager/client_secrets.json:z,ro \
|
|
|
|
-v $PWD/tmp:/var/tmp:z,rw \
|
2024-12-20 17:30:23 +00:00
|
|
|
-v $PWD/static:/opt/app-root/lib/python3.12/site-packages/mirrormanager2/static:z,ro \
|
|
|
|
-v $PWD/templates:/opt/app-root/lib/python3.12/site-packages/mirrormanager2/templates:z,ro \
|
2024-08-29 23:20:59 +00:00
|
|
|
-d git.resf.org/infrastructure/mirrormanager2:dev
|
2024-08-28 12:51:25 +00:00
|
|
|
|
|
|
|
# Setup sqlite database
|
|
|
|
echo "mirrormanager2 and nginx have been statred. You may need to run:"
|
|
|
|
|
|
|
|
echo "podman exec mm2 /usr/bin/python3 -m flask -A mirrormanager2.app db sync"
|