Giter Site home page Giter Site logo

jkstarling / t5oil_sl_docker_ec2 Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 204 KB

Streamlit with DOCKER on AWS EC2 example. From https://github.com/entbappy/Streamlit-app-Docker-Image

License: MIT License

Python 65.91% Dockerfile 0.38% Jupyter Notebook 33.72%

t5oil_sl_docker_ec2's Introduction

How to Deploy Streamlit app on EC2 instance

1. Login with your AWS console and launch an EC2 instance

2. Run the following commands

Note: Do the port mapping to this port:- 8501

sudo apt-get update -y

sudo apt-get upgrade

#Install Docker

curl -fsSL https://get.docker.com -o get-docker.sh

sudo sh get-docker.sh

sudo usermod -aG docker ubuntu

newgrp docker

(may require sudo)

sudo mkdir /app

cd /app

git clone https://github.com/jkstarling/T5OIL_SL_DOCKER_EC2.git

cd /T5OIL_SL_DOCKER_EC2

docker build -t streamlit .

docker images -a  
docker run -d -p 8501:8501 entbappy/stapp 
docker ps  
docker stop container_id
docker rm $(docker ps -a -q)
docker login 
docker push entbappy/stapp:latest 
docker rmi entbappy/stapp:latest
docker pull entbappy/stapp

code removed from example here: https://docs.streamlit.io/deploy/tutorials/docker#check-network-port-accessibility

#3.93.198.219"]

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health

OLD CODE

sudo apt update

sudo apt-get update

sudo apt upgrade -y

sudo apt install git curl unzip tar make sudo vim wget -y

sudo apt install python3-pip

Make a new folder in /home called /apps. Then copy the github repo:

sudo git clone https://github.com/jkstarling/T5OIL_SL_DOCKER_EC2.git
pip3 install -r requirements.txt

If the above doesn't work, you need to install pipx.

sudo apt install pipx
pipx ensurepath
pipx install -r requirements
(OR)
pipx install streamlit

Or if that doesn't work, try to install venv and start a virtual environment.

python3 -m venv venv
source venv/bin/activate
pip3 install streamlit
#Temporary running
python3 -m streamlit run app.py

#Permanent running
nohup python3 -m streamlit run app.py

Note: Streamlit runs on this port: 8501

t5oil_sl_docker_ec2's People

Contributors

jkstarling avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.