Where is my python-flask app source stored on ec2 instance deployed with elastic beanstalk?

2.8k views Asked by At

I just deployed a flask-python app with elastic beanstalk on AWS but cannot locate my app source files like application.py or templates/index.html etc

I've looked at looked at /var/../.. or /opt/../.. etc but nowhere to be found.

Is there an ebs command like $ eb find 'filename.py' etc?

2

There are 2 answers

1
dkarchmer On
  • /opt/python – Root of where you application will end up.
  • /opt/python/current/app – The current application that is hosted in the environment.
  • /opt/python/on-deck/app – The app is initially put in on-deck and then, after all the deployment is complete, it will be moved to current. If you are getting failures in yourcontainer_commands, check out out the on-deck folder and not the current folder.
  • /opt/python/current/env – All the env variables that eb will set up for you. If you are trying to reproduce an error, you may first need to source /opt/python/current/env to get things set up as they would be when eb deploy is running.
  • opt/python/run/venv – The virtual env used by your application; you will also need to run source /opt/python/run/venv/bin/activate if you are trying to reproduce an error
0
brandondavid On

As of today, using the default AWS Linux option when creating eb (Python 3.7 running on 64bit Amazon Linux 2/3.1.1), I found the application files in:

/var/app/current

If that doesn't work you can search for a file that you know to be unique in your app, e.g

sudo find / -name hello.html

In my case the above returns /var/app/current/templates/hello.html