All Questions

Coding

How can I deploy a python function with a requirements.txt file on digital ocean? [SOLVED]

I am trying to deploy my python function on digital ocean but I only see the option to copy paste my code, however, I want too also deploy a file with the requirements.txt

author Tiago Ferreira

Reply
14 Answers

Digital Ocean VPS? … why’re you not SSH’ing. If you don’t want it to be manual, you could use something like Github Actions https://www.digitalocean.com/community/tech-talks/deploying-to-digitalocean-with-github-actions

writen by Sanat Hegde

SHH only works if I have a machine running right? I have a function. It’s supose to be serverless

writen by Tiago Ferreira

that is what I am following at the moment too but still did not understand how to get the requirements.txt XD

writen by Tiago Ferreira

any ideas <@U02NH9BN5FY>, <@U03G1DUCH47>, Matthias Endler?

writen by Tiago Ferreira

Unfortunately I haven’t used digitalocean so far

writen by Benedikt

Nah sorry, I don’t work with

writen by WBE User

Do you work with digital ocean though WBE User?

writen by Tiago Ferreira

Little bit

writen by WBE User

so far I am not impressed. The documentation is terrible!!

writen by Tiago Ferreira

Then don’t look into Azure or AWS 😊

writen by WBE User

So apparently by including a build.sh file in the project folder it will first run that build script… Even though that is nowhere in the documentation

writen by Tiago Ferreira

My saga continues I thought that the packages were being installed on DigitalOcean side, but instead it turns out that the pip is running in my machine before I guess zipping and pushing the code. So, in the end I still have the same issue of the python packages not being installed

writen by Tiago Ferreira

FIXED You need to add a build.sh file in your function folder with the following commands



set -e


virtualenv virtualenv
source virtualenv/bin/activate
pip install -r requirements.txt
deactivate```

writen by Tiago Ferreira

Do you want to ask a question?


Related Questions