[PYTHON] Google App Engine development with Docker

We have released a Docker Container for Google App Engine development.

docker-gae-python is the GAE sdk for python + library and compiler, and docker-gae-python-extra is packed with the tools you are using.

How to use

Both start as follows,

sudo docker run -d -p 2022:22 -p 8080:8080 -v (Absolute path to the project root):/home/gae:rw essa/gae-python-extra /usr/sbin/sshd -D

Log in and use as follows. The initial password is python.

ssh -p 2022 [email protected]

The following command will launch the sample app.

python /usr/local/google_appengine/dev_appserver.py /usr/local/google_appengine/demos/python/guestbook --port 8080 --host 0.0.0.0

From the host, you can access it at http: // localhost: 8080 /.

If you publish 8080 on the host firewall, you can access it from the outside. Since the Dockerfile with the password is published, please change the password when publishing 2022 of the ssh port to the outside.

Impressions of Docker

I've tried Docker for the first time and I think it's certainly useful.

The environment of GAE SDK for python is relatively easy to create, but since the project I'm doing now uses closureCompiler, SASS, and casper.js (phantom.js), the execution environment of ruby, java, and node.js is also available. You will need. It was difficult to create an environment where all of this works from scratch, and I was worried about how to write the explanation, but if I publish it as an image of Docker, it will be ready soon.

Even if you can't publish the image, if you attach the Dockerfile to the project, it will take some time, but you can create the same environment with a single docker build command.

For now, it may be difficult to create an execution environment for Docker, but if the cloud that can use coreos becomes widespread, it will be possible soon.

Creating a Dockerfile is almost the same as writing a shell script for building an environment, but since it commits the file system image of the execution result for each line of the RUN command, when it is re-executed, it automatically starts from the corrected line. Thank you for restarting.

What I didn't expect in the positive direction when I actually used it was that this feature made writing a Dockerfile easier than I expected.

This kind of script and environment construction tool

  1. Write it all and run the test
  2. There is a time-consuming process that works
  3. Corrected a minor mistake near the end
  4. It takes time to re-execute everything, so execute only the corrected part and check
  5. Then it works, but when I run it from the beginning I get an error

So, if you do everything honestly from the beginning, it takes time, so it tends to be a pattern of tears if you mistakenly delete the script that you are about to write by mistake in the process of initializing the environment.

I think that the main purpose of using Docker is to quickly start up a machine for production operation, but I feel that it can also be used to prepare a development environment and share it.

TIPS

I don't know much yet, but I'll make a note of where I stumbled.

Recommended Posts

Google App Engine development with Docker
I can't deploy with google app engine
Building a development environment with Maven on Google App Engine [Java]
Google App Engine / Python development environment construction procedure (late 2014)
PIL with Python on Windows 8 (for Google App Engine)
Getting Started with Google App Engine for Python & PHP
Hello World with Google App Engine (Java 8) + Servlet API 3.1 + Gradle
Java 1 1 support from Google App Engine
Deploy your Go app on Google App Engine with GitHub Actions
Use ndb.tasklet on Google App Engine
Hello World with Google App Engine (Java 11) + Spring Boot + Gradle
Rebuild Django's development environment with Docker! !! !! !!
Application development with Docker + Python + Flask
Using properties files with Flexible Environment Java 8 on Google App Engine
[Google App Engine] Flow from development environment construction to application creation
[Python] Run Flask on Google App Engine
[Google App Engine] User Objects (Japanese translation)
Use external modules on Google App Engine
Deploy a Python app on Google App Engine and integrate it with GitHub
Build Django + NGINX + PostgreSQL development environment with Docker
Go (Echo) Go Modules × Build development environment with Docker
[Python] Build a Django development environment with Docker
Tweet (API 1.1) on Google App Engine for Python
Google App Engine Datastore and Search API integration
Use Docker development container conveniently with VS Code
Turn off optimization options in the Google App Engine Go development environment dev_appserver.py
Authenticate Google with Django
Tftp server with Docker
Development digest with Django
Deploy a Django application on Google App Engine (Python3)
(Beginner) Basic usage of Datastore on Google App Engine
Deploy an existing app with docker + pyenv-virtualenv + uwsgi + django
linux with termux app
Use python with docker
Proxy server with Docker
Hello, World with Docker
How to use Django on Google App Engine / Python
Various memorandums when using sdk of LINE Messaging API with Python (2.7.9) + Google App Engine
Build a development environment with Poetry Django Docker Pycharm
Runtime version of Google App Engine / Python Standard Environment
Do you have any recommendations for a commentary book on Google App Engine / Python development?
Settings when developing App Engine / Python apps with VS Code
Build a Django development environment with Docker! (Docker-compose / Django / postgreSQL / nginx)
Save in Japanese to StringProperty in Google App Engine data store
Do embedded programming by test-driven development with google test-SOLID design-
[Django] Build a Django container (Docker) development environment quickly with PyCharm
Create a simple Python development environment with VSCode & Docker Desktop
How to write to update Datastore to async with Google Apps Engine
Create a Todo app with Django ① Build an environment with Docker
Todo app with django-bootstrap-modal-forms plugin
Test embedded software with Google Test
Try Google Mock with C
Study Python with Google Colaboratory
Web application development with Flask
About learning with google colab
Docker Engine --CE source build
Implement PyTorch + GPU with Docker
PySpark life starting with Docker
Prepare python3 environment with Docker
Mount google drive with google-drive-ocamlfuse
Access Google Drive with Python