Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker compose full stack #80

Closed

Conversation

scott2b
Copy link
Contributor

@scott2b scott2b commented Jul 15, 2020

What:
Creates a docker-compose stack to simplify development onboarding. See primarily the DOCKER.README.md file, and the docker-compose.yml file. Also some tweaks in the API configurations to support this setup, and JSON encoding tweaks in the API code itself to handle Decimal encoding.

Why:
To simplify the onboarding process for new developers. docker-compose up will yield a full development stack -- the new developer only needs then to load in data required for development.

For the reviewer:
The onboarding process is described in the DOCKER.README.md. I was unable to get functionality in the client working without including 1-year, 5-year, and tiger data, so the documentation reflects this. I did end up truncating 5-year data for sanity and simply due to disk space limitations.

The stack itself is laid out in the docker-compose.yml file. Note that this brings up memcached and localstack (for s3), however the default configuration bypasses the cache as described in the README.

The postgres build is defined by postgres/Dockerfile, and utilizes pg9.6+pgis2.5. I had too much trouble getting the data to load with pg9.5. *sql and *sql.gz files in postgres/data are loaded by initdb (during docker-compose up) and are git-ignored.

Mostly, the code itself is untouched, so these changes should stand fairly alone. I did make some tweaks to the config.py file, but have tried to maintain previous defaults so as not to break the setup for any current devs. I also added a Decimal encoder for JSON encoding in the API -- it's not clear to me how the current code is working without it and was necessary in order for me to get this up and running.

I have not done a lot of diligence with the client. I have checked the basic auto-fill search function on the main page against some municipalities, and I have poked through some of the categories at the bottom and tried a handful of searches in various categories, but I am not super familiar with usage patterns, so you may surface issues, or have suggestions of patterns/endpoints you want me to check.

@JoeGermuska
Copy link
Member

Sorry to do this to your work, @scott2b but with the new Dokku-based environment, we already have a deployment dockerfile. If we want to support local development with Docker, we need to step back and work in concert with that. (I spent a couple of minutes trying and ran into some things which would need to be externalized/parameterized, and rather than ask @iandees to help me with that, I just got census-api working pretty easily using pipenv )

I'm still curious about the idea of using Docker for both local developement and deployment, but it's not a top priority.

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.

None yet

2 participants