Skip to content

Installation

guydegnol edited this page Sep 27, 2023 · 20 revisions

Quick Installation guide

# πŸ“‹ Clone the code from github
git clone https://github.com/gtherin/trianer
# πŸ‹ Build the app with docker
docker build . -t trianer-image
# πŸš€ Launch the app: it should open a window in your browser
docker run -p 8502:8502 --name trianer-container trianer-image

Other info: 🏊Docker 🚴Heroku πŸƒGoogle cloud 🚢Misc

Deploy through docker

Run the app

  • First, you need to build the docker image:
docker build . -t trianer-image
  • Then, you can launch the app (server will run on port 8505 by default):
docker run -p 8502:8502 --name trianer-container trianer-image

Other info

  • The config file of docker is in the Dockerfile file.:
# Base Image to use
FROM python:3.10-slim

# Change Working Directory to app directory
WORKDIR /app
ADD . ./
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt \
    && rm -rf requirements.txt
WORKDIR /app

# Choose port
EXPOSE 8502
CMD sh setup.sh && streamlit run app.py --server.fileWatcherType none

Here is a few docker commands to deploy the project:

  • Other useful commands:
# Restart the local container
docker restart trianer-container

# List the container
docker ps

# Kill all the local container
docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)

Deploy the app on Heroku

# To run it locally
heroku local

# To restart the heroku server
heroku ps:scale web=0 
heroku restart

# To check heroku logs
heroku logs --tail
heroku builds:cache:purge -a fathomless-brook-99194  --confirm fathomless-brook-99194

Deploy the app on google cloud

https://medium.com/analytics-vidhya/deploying-streamlit-apps-to-google-app-engine-in-5-simple-steps-5e2e2bd5b172

gcloud: Configuration is in the app.yaml and script

# Build
docker build . -t trianer-image

# Deploy
gcloud app deploy app.yaml --quiet

# Some gcloud options
gcloud projects create default
gcloud projects list
gcloud config configurations list

Some developpers tips

# Kill all streamlit servers
killall streamlit

# Push the code
trianer-push

# Add a heroku link
git remote set-url heroku https://git.heroku.com/aplast.git

Info on the app's tabs:

  1. πŸ’—Athlete
  2. 🌍Race
  3. πŸŠπŸš΄πŸƒPerformances
  4. πŸ†Simulation
  5. πŸ’¦Training

Other pages

Clone this wiki locally