diff --git a/Dockerfile b/Dockerfile index a2c83413..0d7791ca 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ ENV BLUE_ENGINE_CNAME=$BLUE_ENGINE_CNAME RUN apt-get update -y && \ apt-get upgrade -y && \ - apt-get install nginx gcc git build-essential vim dnsutils -y && \ + apt-get install nginx gcc git build-essential vim dnsutils secure-delete -y && \ apt-get clean -y && \ apt-get autoremove -y diff --git a/build-test-compose-locally.yml b/build-test-compose-locally.yml new file mode 100644 index 00000000..06324f60 --- /dev/null +++ b/build-test-compose-locally.yml @@ -0,0 +1,16 @@ +# A copy of build-test-compose.yml except it has "network_mode: host" +# so you can connect it to the host's database when testing locally. +version: '3.8' +services: + ais: + network_mode: "host" + container_name: ais + image: ais + build: + context: . + dockerfile: Dockerfile + environment: + - ENGINE_DB_HOST + - ENGINE_DB_PASS + ports: + - "8080:8080" diff --git a/docker-build-files/entrypoint.sh b/docker-build-files/entrypoint.sh index ac03de2c..ea5f50ca 100644 --- a/docker-build-files/entrypoint.sh +++ b/docker-build-files/entrypoint.sh @@ -53,13 +53,18 @@ declare -a pdata_files=('alias' 'alias_streets' 'apt' 'apt_std' 'apte' 'centerline' 'centerline_streets' 'directional' 'landmarks' 'name_switch' 'saint' 'std' 'suffix' ) +# Update passyunk pdata files everytime the container starts. +echo 'Pulling in passyunk package to update pdata files with command "pip install --force-reinstall git+ssh://git@private-git/CityOfPhiladelphia/passyunk.git@master"..' +pip install --force-reinstall git+ssh://git@private-git/CityOfPhiladelphia/passyunk.git@master &>/dev/null || fail "Failed to update passyunk pdata files!!" +# Delete private ssh key once pulled and running. +srm /root/.ssh/passyunk-private.key + echo "Asserting private data is in passyunk site-package folder" for i in "${pdata_files[@]}" do test -f /usr/local/lib/python3.10/site-packages/passyunk/pdata/$i.csv || fail "$i.csv does not exist in venv!" done - declare -a pdata_files=('election_block' 'usps_alias' 'usps_cityzip' 'usps_zip4s') echo "Asserting private data is in passyunk_automation site-package folder"