Skip to content

Commit

Permalink
Merge pull request #56 from now8-org/build/dockerfile
Browse files Browse the repository at this point in the history
Add Dockerfile
  • Loading branch information
fpurcell committed Dec 23, 2021
2 parents 1749f57 + 2a7678c commit 8638a9d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 3 deletions.
10 changes: 10 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM python:3

RUN pip install zc.buildout psycopg2-binary

WORKDIR /app
COPY . .

RUN buildout install prod postgresql

ENTRYPOINT ["bin/gtfsdb-load"]
16 changes: 13 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Supported Databases
GTFS (General Transit Feed Specification) Database
==================================================

Python code that will load GTFS data into a relational database, and SQLAlchemy ORM bindings to the GTFS tables in the gtfsdb.
Python code that will load GTFS data into a relational database, and SQLAlchemy ORM bindings to the GTFS tables in the gtfsdb.
The gtfsdb project's focus is on making GTFS data available in a programmatic context for software developers. The need for the
gtfsdb project comes from the fact that a lot of developers start out a GTFS-related effort by first building some amount of code
to read GTFS data (whether that's an in-memory loader, a database loader, etc...); GTFSDB can hopefully reduce the need for such
Expand All @@ -46,10 +46,10 @@ Install from source via github (if you want the latest code) :
7. bin/gtfsdb-load --database_url <db url> <gtfs file | url>

examples:

- bin/gtfsdb-load --database_url sqlite:///gtfs.db gtfsdb/tests/large-sample-feed.zip
- bin/gtfsdb-load --database_url sqlite:///gtfs.db http://developer.trimet.org/schedule/gtfs.zip
- bin/gtfsdb-load --database_url postgresql://postgres@localhost:5432 --is_geospatial http://developer.trimet.org/schedule/gtfs.zip
- bin/gtfsdb-load --database_url postgresql://postgres@localhost:5432 --is_geospatial http://developer.trimet.org/schedule/gtfs.zip

NOTE: adding the `is_geospatial` cmdline flag, when paired with a spatial-database ala PostGIS (e.g., is_spatial is meaningless with sqllite), will take longer to load...but will create geometry columns for both rendering and calculating nearest distances, etc...

Expand All @@ -63,6 +63,16 @@ will relieve gtfsdb from re-installing locally as part of the build. And if aft
**"ImportError: No module named psycopg2"**, then 'pip install psychopg2-binary' should fix that up quick...


Usage with Docker
=================

1. Build the image with :code:`docker build -t gtfsdb .`.
2. Run it with
:code:`docker run gtfsdb --database_url <db url> <gtfs file | url>`.
The entrypoint command is :code:`bin/gtfsdb-load`
so the arguments will be passed to it.


Example Query:
==============

Expand Down

0 comments on commit 8638a9d

Please sign in to comment.