Reorganizing project structure - #819
Conversation
Placing most source files under web/ and worker-specific source files under worker/ and test-specific source files under test/. Replaced base Docker image with python:alpine for web and worker images. Moved nginx to a separate image, which will now be used for running locally and in production via docker compose.
|
Still in draft at the moment, but looking to swap out our base image with python3:alpine instead of using ubuntu. Much smaller footprint for our images, which makes for faster builds and deploys. Last execution of the test pipeline prior to this PR took 2m50s. This branch's run completed in 1m32s. Image size for |
|
To follow the reorganization aspect of this change, it would be easier to take a look at the branch file listing. Notably, all the source code for the tornado app has been moved into a "web" directory. The unique files for workers are now in a "worker" directory. I also relocated the tests into a "test" directory (including a test.py module that was in the root). Since this repo produces "web" and "worker" Docker images, it made sense to me to segment those into separate folders. It also gave me the opportunity to streamline the contents of those images. Before, we were producing near identical Docker images for both. Main difference being the installation of nginx for the web image, and configuration for supervisor was different in terms of running nginx instances and the tornado app versus running celery and cron. But all the Python code was included in both images. They should include only the files needed for their operation. The other change was to move the nginx and fakes3 docker files to separate Github repos, so we can build those independently, and simply reference them via Docker compose. I'll have to adjust the web servers to run via the compose file instead of running the image directly. A big advantage to using Alpine for building nginx is that the upload module we utilize is available as an Alpine package, so we no longer have to build nginx from source. |
Placing most source files under web/ and worker-specific source files under worker/ and test-specific source files under test/.
Replaced base Docker image with python:alpine for web and worker images. Moved nginx to a separate image, which will now be used for running locally and in production via docker compose.