-
Notifications
You must be signed in to change notification settings - Fork 0
Installation
guydegnol edited this page Sep 27, 2023
·
20 revisions
# π 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
- 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
- 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)
# 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
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
# 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
- πAthlete
- πRace
- ππ΄πPerformances
- πSimulation
- π¦Training
- βοΈInstallation
- πChange logs