Skip to content

Containerized Python and Node apps#1

Open
emcniece wants to merge 1 commit intojoram:mainfrom
emcniece:mac-docker-setup
Open

Containerized Python and Node apps#1
emcniece wants to merge 1 commit intojoram:mainfrom
emcniece:mac-docker-setup

Conversation

@emcniece
Copy link

@emcniece emcniece commented Sep 4, 2022

First pass at containerization, both FE and BE are wrapped up together.

There were several errors between GCC, Debian, Python and GDAL while setting this up - the Dockerfile install steps and setup.py changes are executed in particular order to avoid these problems.

Linux users probably don't need this containerization, but it may be useful for Mac & Windows environments.

Future improvements might include splitting the web_app from the Python server, layer compacting, and pushing to gchr.io.

Give it a test!

make image
make run
# http://localhost:3000 for web frontend
# http://localhost:8000 for Python backend

Comment on lines +11 to +12
libgdal-dev \
gdal-bin
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These two libraries (libgdal-dev, gdal-bin) seem to be needed to install this inside a container, but I'm not convinced that this change needs to happen here in the Makefile.

The Dockerfile has its own apt install steps, and the packages have been copy-pasted from here so as to take advantage of Docker's layer caching. If the Dockerfile installs via RUN make install it will execute each time the image builds, whereas if we use RUN apt install ... the layer will cache, resulting in faster builds.

Since the Dockerfile has its own set of requirements, the Makefile could be considered a tool for localhost Linux installs, and this change could be reverted.

from shapely.geometry import Polygon, Point

from geotiff import GeoTIFFS
from .geotiff import GeoTIFFS
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Mac this threw an error about not finding the GeoTIFFS module. I was able to resolve by forcing a local import. This seems to work inside the Debian container, does it work for localhost Linux too?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant