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

2

9

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?

Transnational answered 27/8, 2017 at 7:42 Comment(2)
How about eb ssh or eb ssh --command? See: docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-ssh.htmlMiltie
I already ssh in and looked at the directories /var/../.. or /opt/../.. etc but don't see any of my application source filesTransnational
O
11
  • /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
Offer answered 2/9, 2017 at 21:4 Comment(1)
Yes! Thank you. This is exactly the info I was looking for. Not sure if this is well documented anywhere, but it is super helpful. Would upvote 10 times if I could.Wyler
M
4

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

Melodics answered 25/9, 2020 at 15:19 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.