Frequently used options on App Engine's local development server dev_appserver.py
.
$ dev_appserver.py app.yaml
Check with http: // localhost: 8080
. The management console is http: // localhost: 8000
.
Do not mix when developing while switching between multiple projects.
$ dev_appserver.py --datastore_path=.datastore app.yaml
If the directory name starts with. (Dot), it will be skipped during deployment. You can specify it explicitly with skip_files: in app.yaml.
When you want to start multiple dev_appserver.py, such as when developing multiple projects in parallel.
$ dev_appserver.py --port=8081 --admin_port=8001 --datastore_path=.datastore app.yaml
Get the official image. For the lightest Alpine linux.
$ docker pull google/cloud-sdk:alpine
Dockerfile.
FROM google/cloud-sdk:alpine
MAINTAINER syousei
RUN gcloud components install app-engine-python
RUN mkdir /app_source
VOLUME /app_source
EXPOSE 8000:8000 8080:8080
Build.
$ docker build -t syousei/appengine-python:alpine .
If you want to be able to use the gcloud command from inside the Docker container, pass authentication. When you type this command, open the URL displayed in your browser, and when the authentication token is displayed, type it to authenticate.
$ docker run -ti --name [DOCKER CONTAINER NAME] syousei/appengine-python:alpine gcloud auth login
Run
$ docker run -it -v C:\Projects\[PROJECT NAME]\app_source:/app_source -p 8080:8080 -p 8000:8000 --name=[DOCKER CONTAINER NAME] syousei/appengine-python:alpine
Start dev_appserver.py.
$ docker exec -itd [DOCKER CONTAINER NAME] dev_appserver.py --host 0.0.0.0 --admin_host 0.0.0.0 --datastore_path=/tmp/datastore /app_source/app_dev.yaml
that's all.
Recommended Posts