Created
September 12, 2023 14:39
-
-
Save leifermendez/5804fd130b2ae8232e8edae768125cd4 to your computer and use it in GitHub Desktop.
waiter.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
```bash | |
#!/bin/bash | |
OPENAI_API_KEY='' | |
ID_TENANT='' | |
EXTERNAL_API_KEY='' | |
CONTAINER_NAME='' | |
PORT='' | |
while getopts o:i:e:n:p: flag | |
do | |
case "${flag}" in | |
o) OPENAI_API_KEY=${OPTARG};; | |
i) ID_TENANT=${OPTARG};; | |
e) EXTERNAL_API_KEY=${OPTARG};; | |
n) CONTAINER_NAME=${OPTARG};; | |
p) PORT=${OPTARG};; | |
esac | |
done | |
# Crear directorios si no existen | |
[ ! -d "/root/sessions/${ID_TENANT}_sessions" ] && mkdir -p /root/sessions/${ID_TENANT}_sessions | |
[ ! -d "/root/tmp" ] && mkdir -p /root/tmp | |
# Cambiar permisos de los directorios | |
chmod -R 777 /root/sessions/ | |
chmod -R 777 /root/tmp | |
docker run -d \ | |
--name=${CONTAINER_NAME} \ | |
--restart=always \ | |
-e OPENAI_API_KEY=${OPENAI_API_KEY} \ | |
-e ID_TENANT=${ID_TENANT} \ | |
-e EXTERNAL_API_KEY=${EXTERNAL_API_KEY} \ | |
-p ${PORT}:4000 \ | |
--cap-add=SYS_ADMIN \ | |
-v /root/sessions/${ID_TENANT}_sessions:/app/${ID_TENANT}_sessions \ | |
-v /root/tmp:/app/tmp \ | |
leifermendez/bot-restaurante-gpt:latest | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment