mirrormanager2-container/start-dev.sh
2024-08-30 15:35:47 -04:00

31 lines
1.2 KiB
Bash

POD=mirrormanager2
podman pod exists $POD || podman pod create -p 5000:5000 -n $POD
test -d tmp || mkdir tmp
test -f client_secrets.json || (echo "missing client_secrets" && exit 2)
podman build -t git.resf.org/infrastructure/mirrormanager2:dev -f Containerfile
podman rm --force mm2 -t 1
podman run \
--pod $POD \
--name mm2 \
--replace \
-e 'MM2_CONFIG=/etc/mirrormanager/mirrormanager2.cfg' \
-e "MM2_SECRET_KEY=$(openssl rand -hex 32)" \
-e "MM2_PASSWORD_SEED=$(openssl rand -hex 32)" \
-e 'MM2_THEME_FOLDER=rocky' \
-e 'FLASK_DEBUG=1' \
-e 'MM2_DEBUG=1' \
-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 \
-v $PWD/static:/usr/lib/python3.12/site-packages/mirrormanager2/static:z,ro \
-v $PWD/templates:/usr/lib/python3.12/site-packages/mirrormanager2/templates:z,ro \
-d git.resf.org/infrastructure/mirrormanager2:dev
# 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"