Closed ginglis13 closed 4 years ago
Addresses #32
Added a short Dockerfile that uses the Postgres docker image to initialize a table, "budget_data", with all CSV data in /data/states. Included CreateDB.sql, which contains the SQL commands to run on initializing the Postgres daemon.
/data/states
docker build -t "db:PostgresDockerfile" . -f PostgresDockerfile
docker run -d db:PostgresDockerfile
docker exec -it $HASH psql -U docker
select * from "budget_data";
I have these files currently at the top level directory of this project, but if that causes too much clutter, we can find a different place for them.
Works, yeah will reorg the project after API image built
Description
Addresses #32
Added a short Dockerfile that uses the Postgres docker image to initialize a table, "budget_data", with all CSV data in
/data/states
. Included CreateDB.sql, which contains the SQL commands to run on initializing the Postgres daemon.How to use it
docker build -t "db:PostgresDockerfile" . -f PostgresDockerfile
docker run -d db:PostgresDockerfile
# this will output a hash for the running containerdocker exec -it $HASH psql -U docker
# use the hash output from command 2select * from "budget_data";
. The quotes are important.Organization
I have these files currently at the top level directory of this project, but if that causes too much clutter, we can find a different place for them.