GoogleCloudPlatform / appstart

Tool for running a GAE MVM emulation environment.
Apache License 2.0
12 stars 11 forks source link

Static files aren't being served by appstart (404) #18

Closed mbof closed 8 years ago

mbof commented 9 years ago

Unsure whether this is a known issue: static fileserving doesn't seem to be working in appstart. This is with docker-machine on OSX.

Repro steps:

  1. Create an app with some static content using this script: http://pastebin.com/gxdRKUEc [The app has two pages: one served at / from python which outputs "Hello, python world!", and one static text file served at /static/hello.txt containing "Hello, static world!"]
  2. Run the app with dev_appserver and access localhost:8080/static/hello.txt
  3. Run the app with appstart and access :8080/static/hello.txt

Observed: Static file is served correctly after [2]. Error 404 is served after [3].

Expected: Static file is served correctly in both cases.

[Note: The page at / correctly serves "Hello, python world!" in both cases.]

mindhog commented 9 years ago

This is because we're not proxying through dev_appserver, IIRC this was to avoid a port conflict with the user's application when running on the same IP stack.

I think we'll have to revert to proxying to remedy this, which means we'll need to run the dev_appserver on a different port.

mindhog commented 9 years ago

My previous comment was incorrect: we are proxying through the dev_appserver, We weren't copying static_dir trees over, which I've fixed, but dev_appserver is still not serving static files. Looking into why.

mindhog commented 8 years ago

Sorry this has sat so long :-/

The work-around is to copy static files to your app container and create a handler to serve them from there. I think the real fix needs to be added to dev_appserver, which I'm going to try to persue.

mbof commented 8 years ago

No worries, I am no longer blocked by this as I needed something soon and moved away from Managed VM altogether because of other issues.

mindhog commented 8 years ago

Fixed in 8f7524c1fdcf02c98eb6590b5603d52289cd7b52

Note: You'll need to use the proxy port (defaults to 8088) instead of the application main port (defaults to 8080) but you should get complete functionality, i.e. application hooks plus static files.