{"id":24911480,"url":"https://github.com/hackoregon/transportation-systems-docker","last_synced_at":"2025-03-28T03:14:52.018Z","repository":{"id":75397828,"uuid":"118042041","full_name":"hackoregon/transportation-systems-docker","owner":"hackoregon","description":"2018 Repo for Transportation Systems Docker Environment","archived":false,"fork":false,"pushed_at":"2018-01-31T03:09:51.000Z","size":520,"stargazers_count":4,"open_issues_count":4,"forks_count":0,"subscribers_count":17,"default_branch":"master","last_synced_at":"2025-02-02T04:23:19.817Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hackoregon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-18T21:45:04.000Z","updated_at":"2023-05-06T20:42:20.000Z","dependencies_parsed_at":"2023-06-06T09:15:27.384Z","dependency_job_id":null,"html_url":"https://github.com/hackoregon/transportation-systems-docker","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Ftransportation-systems-docker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Ftransportation-systems-docker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Ftransportation-systems-docker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hackoregon%2Ftransportation-systems-docker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hackoregon","download_url":"https://codeload.github.com/hackoregon/transportation-systems-docker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245960813,"owners_count":20700781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-02T04:20:26.886Z","updated_at":"2025-03-28T03:14:51.997Z","avatar_url":"https://github.com/hackoregon.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Quickstart\n\nQuickest way to to get a GEODJANGO container up and running:\n\n1. Unless you are developing on the image itself you'll want to create your own Github repo and then clone locally so you have a base repo. Use the python .gitignore template.\n\n2.  cd into directory `$ cd \u003cyour-repo`\n\n3. Open the .gitignore file in your text editor and add: `**/env.sh` and save.\n\n4. Create a env.sh file (You might want to create a directory ie: `$mkdir bin` to house this and other files, but instructions will be based on all files at root).\n\n5. Open the env.sh file in a text editor and add the following variables with your chosen values:\n\n```\nexport PROJECT_NAME='\u003cYOUR_PROJECT_NAME\u003e'\nexport DEBUG='BOOL_DEBUG_MODE'\nexport API_DOCKER_IMAGE='YOUR_DESIRED_LOCAL_DOCKER_IMAGE'\nexport CONTAINER_NAME='LOCAL_CONTAINER_NAME'\n\n```\n\n6. Create GEODJANGO DOCKERFILE in root of github repo\n\nFor the GeoDjango container, which can be used as the basis for any project needing to provide a Django Rest Framework API to serve GIS based data this would be your basic template:\n\n```\nFROM bhgrant/hacko-geodjango\nENV PYTHONUNBUFFERED 1\nEXPOSE 8000\n\nWORKDIR /code\nCOPY requirements.txt /code/\nRUN pip install -r requirements.txt\nRUN python\nCOPY . /code/\nENTRYPOINT [ \"/code/docker-entrypoint.sh\" ]\n```\n\n7. Create GeoDjango entrypoint file\n\n`$ touch docker-entrypoint.sh`\n\nNow let's open this file up in your text editor of choice.\n\nAt this point you may only be entering in the basic django startup command to run the dev server environment:\n\n```\n#! /bin/bash\n\npython3 manage.py runserver 0.0.0.0:8000\n```\n\nGo ahead and save this file.\n\n8. Create the requirements.txt file  \n\nThe above DOCKERFILE uses pip to install any additional python packages you may need. If you don't want to create this file at this time, you may opt not to but will have to remove the related lines from the DOCKERFILE.\n\n9. Create the docker-compose.yml file (You are probably going to want to include a POSTGRES or another database container in this but you should be able to run a basic development implementation using the defuault sqlite):\n```\nversion: '3'\nservices:\n  api:\n    environment:\n    - DEBUG=${DEBUG}\n    - PROJECT_NAME=${PROJECT_NAME}\n    build:\n      context: .\n    image: \"${API_DOCKER_IMAGE}\"\n    command: /docker-entrypoint.sh\n    volumes:\n      - ..:/code\n    ports:\n      - \"8000:8000\"\n```\n\nThe [Docker-Compose Reference | Docker](https://docs.docker.com/compose/compose-file/) will be your source of truth on the individual pieces of this.\n\n10. Source the environment file: `source $ /path/to/env.sh`\n\n11. You should now be able to create an initial Django project by running the following command:\n\n```\n`docker-compose -p $PROJECT_NAME run api django-admin.py startproject $PROJECT_NAME .`\n```\n\n12. At this point you should be able to startup your basic Django app:\n\n```\ndocker-compose -p $PROJECT_NAME up\n```\n\n13. And go to `localhost:8000` in your browser to see the initial DJANGO APP\n\n14. If you keep this container running and open a new terminal window you should be able to ssh into the container:\n\n```\ndocker exec -it \u003cYOUR_CONTAINER_NAME\u003e /bin/bash\n```\n\n15. At this point you can run bash commands and the like.\n\n16. You should be able to start developing. You may want to add a more advanced database (https://github.com/hackoregon/postgis-geocoder-test), walkthrough the GeoDjango tutorial (https://docs.djangoproject.com/en/2.0/ref/contrib/gis/tutorial/), or build a Django Rest Framework (http://www.django-rest-framework.org/) app with the POSTGIS backing as next steps. Using the ssh shell could help with this.\n\n\n## Docker Environment\n\nThis portion of the guide, will also provide some introductory information into Docker to help our volunteers get up and running in this project season.\n\n## Getting Started - What is Docker?\n\nIf you are not familiar with Docker, your first step should be understanding the basics of Docker, ie how it works, some terms, and how it is different then running a full virtual machine like Vagrant.\n\nI would suggest watching this video to get a short introduction into Docker:  \n[Docker Tutorial - What is Docker \u0026 Docker Containers, Images, etc?](https://www.youtube.com/watch?v=pGYAg7TMmp0)\n\n\nThis is also a great guide to review:  \n[A Beginner-Friendly Introduction to Containers, VMs and Docker](https://medium.freecodecamp.org/a-beginner-friendly-introduction-to-containers-vms-and-docker-79a9e3e119b)\n\nNext, you will need to install Docker if you have not already...\n\n\n## Installing Docker\n\nInstead of providing specific instructions here, we will link to the Docker guides on installing.\n\n* We will be working with Docker CE (Community Edition) as an Open Source Project.\n\n### Installing for Macs\n\n*System Requirements*\n\n* Mac hardware must be a 2010 or newer model, with Intel’s hardware support for memory management unit (MMU) virtualization; i.e., Extended Page Tables (EPT) and Unrestricted Mode. You can check to see if your machine has this support by running the following command in a terminal: sysctl kern.hv_support\n\n* macOS El Capitan 10.11 and newer macOS releases are supported. At a minimum, Docker for Mac requires macOS Yosemite 10.10.3 or newer, with the caveat that going forward 10.10.x is a use-at-your-own risk proposition.\n\n* Starting with Docker for Mac Stable release 1.13, and concurrent Edge releases, we will no longer address issues specific to macOS Yosemite 10.10. In future releases, Docker for Mac could stop working on macOS Yosemite 10.10 due to the deprecated status of this macOS version. We recommend upgrading to the latest version of macOS.\n\n* At least 4GB of RAM\n\n* VirtualBox prior to version 4.3.30 must NOT be installed (it is incompatible with Docker for Mac). If you have a newer version of VirtualBox installed, it’s fine.\n\nIf your system does not meet these minimum requirements you will not be able to run Docker for Mac. You may attempt to run using [Docker Toolbox](https://docs.docker.com/toolbox/overview/) but this has not been tested and we may have limited assistance to troubleshoot issues.\n\n*Installation*\n\nWhen you are ready follow Docker's Official Guide to install Docker for Mac:  \n[Docker for Mac Installation](https://docs.docker.com/docker-for-mac/install/)\n\nAll work should be done using the \"Stable\" build.\n\n### Installing for Windows 10\n\n\u003cUpdate Coming\u003e\n\n### Installing for Ubuntu/Linux Systems\n\nYou will want to consult Docker's Guides to installation on Linux Systems:\n\n* [Ubuntu](https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/)\n* [Debian](https://docs.docker.com/engine/installation/linux/docker-ce/debian/)\n* [CentOS](https://docs.docker.com/engine/installation/linux/docker-ce/centos/)\n* [Fedora](https://docs.docker.com/engine/installation/linux/docker-ce/fedora/)\n\n### About this Repo\n\nThis repo contains the source files for building the docker images that will be used to and deploy the 2018 Hack Oregon Transportation Systems API and Database. The base image has been built to use only env variables for repo name and other assets. As such it should be useful across other teams.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Ftransportation-systems-docker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhackoregon%2Ftransportation-systems-docker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhackoregon%2Ftransportation-systems-docker/lists"}