#!/bin/bash
set -e

# Set the license
cpconfig -license -set "$CRYPTOPRO_LICENSE"

# Create container folder
mkdir -p /var/opt/cprocsp/keys/appuser/cont

# Copy container
cp -r /app/cont /var/opt/cprocsp/keys/appuser/

# Install container
certmgr -inst -file /var/opt/cprocsp/keys/cert.cer -cont "$CRYPTOPRO_CONTAINER"

# python -m alembic upgrade head
python server.py
