Skip to content

AUTOM77/Docker-instant-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

instant-ai-deploy

CI Status CI Status Docker Pulls Code Size License: MIT Open Issues

AI Infra on Multi-platform: linux/amd64, linux/arm64, linux/arm, linux/s390x and linux/ppc64le;

🚧 Building .. 🚧

Run

AI_SERVICE_HOST="host.containers.internal"

doas podman run --restart=always -itd \
    --name instant-ai \
    -e DOMAIN=$DOMAIN \
    -e CF_Token=$CF_Token \
    -e CF_Zone_ID=$CF_Zone_ID \
    -e CF_Account_ID=$CF_Account_ID \
    -e AI_SERVICE_NAME=$AI_SERVICE_NAME \
    -e AI_SERVICE_HOST="$AI_SERVICE_HOST" \
    -e AI_SERVICE_PORT=$AI_SERVICE_PORT \
    -p 80:80 \
    -p 443:443 \
    -v /etc/ssl/$DOMAIN:/etc/nginx/ssl:rw \
    monius/docker-instant-ai

Unix Socket

DOMAIN='xx.com'
CF_Token='xToken'
CF_Zone_ID='zID'
CF_Account_ID='aID'
AI_SERVICE_NAME='ai'
AI_SOCKET='/dev/shm/infra.sock'

doas podman run -itd \
    --name instant-ai \
    -e DOMAIN=$DOMAIN \
    -e CF_Token=$CF_Token \
    -e CF_Zone_ID=$CF_Zone_ID \
    -e CF_Account_ID=$CF_Account_ID \
    -e AI_SERVICE_NAME=$AI_SERVICE_NAME \
    -e AI_SOCKET=$AI_SOCKET \
    -v $AI_SOCKET:$AI_SOCKET \
    -v /etc/ssl/$DOMAIN:/etc/nginx/ssl:rw \
    -p 443:443 \
    monius/docker-instant-ai

Test

doas podman run --name ii -p 80:80 -p 443:443 -itd monius/docker-instant-ai
doas podman run --name ii -itd monius/docker-instant-ai
doas podman run --rm monius/docker-instant-ai 
doas podman run --name ii -it monius/docker-instant-ai /bin/sh
doas podman run --name ii -p 80:80 -p 443:443 -it monius/docker-instant-ai /bin/sh

doas podman run -itd \
    --name instant-ai \
    -e DOMAIN=domain \
    -e CF_Token=cf_api_token \
    -e CF_Zone_ID=cf_zone_id \
    -e CF_Account_ID=cf_acc_id \
    -e AI_SERVICE_NAME=ai_name \
    -e AI_SERVICE_PORT=ai_port \
    -p 80:80 \
    -p 443:443 \
    monius/docker-instant-ai

doas podman logs ii
doas podman inspect -f '{{.NetworkSettings.IPAddress}}' ii
doas podman rm -f $(doas podman ps -a -q) 
doas podman rmi -f $(doas podman images -a -q)

Reference

  1. https://www.nginx.com/blog/inside-nginx-how-we-designed-for-performance-scale
  2. https://kisspeter.github.io/fastapi-performance-optimization/nginx_port_socket.html
  3. https://gist.github.com/3052776
  4. https://dev.to/abhijithganesh/how-to-deploy-any-python-web-application-1707

About

AI-infra with Podman

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published