Skip to content

smarthi/docker-scaffolding

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Template Project

This is a project template that creates a Docker environment with useful containers for the Data For Democracy project.

Docker is a technology that allows you to package up all of the dependencies for a project in a portable way. It's like virtual environments, but extending to the whole OS, not just Python packages.

This template sets up a Node webapp server, Flask webapp server, a Conda environment running Jupyter, and Postgres and MongoDB databases that they can talk to. The idea is that you'll delete the pieces that you don't intend to use (remove them from docker-compose.yml and delete the directories), and customize the ones you do.

To get started:

  1. Install Docker: https://www.docker.com/products/overview

  2. In this directory, run docker-compose up This will take a while the first time you do it, because it's downloading all of the dependencies for all of the subparts of the project. It should be much faster after the first time.

  3. In the output, you should see lines like these, telling you where to connect:

conda_1     |     Copy/paste this URL into your browser when you connect for the first time,
conda_1     |     to login with a token:
conda_1     |         http://localhost:5002/?token=9c010637753fdf9646eb75a3d6b36b0a5e5464e5b5d32df3

flask_1     |  * Running on http://0.0.0.0:5001/ (Press CTRL+C to quit)

node_1      | Running on http://localhost:5003
  1. To stop all of the running services, use CTRL+C.

  2. Data stored in the database will be preserved from run to run.

  3. Code put in source/python will be available to both Conda and the Flask server

  4. If you add something to requirements.txt or packages.json use docker-compose up --build to pick up the new dependencies

About

Template for Docker-based projects

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 46.2%
  • Jupyter Notebook 29.3%
  • Shell 9.9%
  • HTML 8.0%
  • JavaScript 5.3%
  • CSS 1.3%