From 6616e8fe84977b70d5b3bbb0bd62c7d8476f626a Mon Sep 17 00:00:00 2001 From: Sam Sciolla Date: Tue, 31 Aug 2021 11:57:02 -0400 Subject: [PATCH 1/2] Update dependencies; add Docker artifacts; update README.md --- .dockerignore | 4 ++++ Dockerfile | 4 ++-- README.md | 16 ++++++++++------ docker-compose.yml | 11 +++++++++++ requirements.txt | 13 +++++++++---- 5 files changed, 36 insertions(+), 12 deletions(-) create mode 100644 .dockerignore create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..9127f11 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +**/env.json + +venv +__pycache__ diff --git a/Dockerfile b/Dockerfile index e039768..8d51896 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,12 +1,12 @@ # Use a Python base image -FROM python:3.7 +FROM python:3.8-slim COPY requirements.txt /requirements.txt RUN pip install -r requirements.txt # arcgis needs to be installed separately because of issues when including the requirement with a flag in # requirements.txt -RUN pip install arcgis --no-deps +RUN pip install arcgis==1.9.0 --no-deps WORKDIR /kartograafr/ COPY . /kartograafr/ diff --git a/README.md b/README.md index 44b934f..49eb836 100644 --- a/README.md +++ b/README.md @@ -153,7 +153,7 @@ The meanings of the keys and their expected values are described in the table be `Canvas_Config_Course_ID` | The ID number of the configuration course, (see the **Canvas** Configuration section above). `ArcGIS_Org_Name` | The name of the ArcGIS organization in use. `ArcGIS_Username` | The name of an arcGIS user with permission for creating and modifying user groups. -`ArcGIS_Passowrd` | The name of the password for the username provided above. +`ArcGIS_Password` | The name of the password for the username provided above. ---------------- @@ -179,26 +179,30 @@ For either option, first you'll need to do the following: cd kartograafr ``` -2. Place the `env.json` file previously created in the `configuration/secrets/` directory. #### With Docker -You can run the application without installing the dependencies manually by leveraging the `Dockerfile` and Docker -Desktop. To run with Docker, do the following: +You can run the application without installing the dependencies manually by leveraging the `Dockerfile`, +`docker-compose.yml`, and Docker Desktop. To run with Docker, do the following: + +1. Place the `env.json` file previously created in the `{HOME}/secrets/kartograafr` directory, + where `{HOME}` is your user's home directory, or `~`. 1. Build an image. ``` - docker build -t kartograafr . + docker compose build ``` 1. Run a container using the tagged image. ``` - docker run kartograafr + docker compose up ``` #### With a Virtual Environment You can also set up the application using `virtualenv` by doing the following: +1. Place the `env.json` file previously created in the `configuration/secrets` directory in the repository. + 1. Create a virtual environment using `virtualenv`. ``` virtualenv venv diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..c6f36a5 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +version: '3' + +services: + job: + build: + context: . + dockerfile: Dockerfile + volumes: + - ${HOME}/secrets/kartograafr:/kartograafr/configuration/secrets + - .:/kartograafr + container_name: kartograafr diff --git a/requirements.txt b/requirements.txt index 164d4ff..ac407c1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,12 @@ # Note: this does not include arcgis, which needs to be installed manually when using virtualenv. # Use the following command: pip install arcgis --no-deps -bs4==0.0.1 -python-dateutil==2.8.1 -requests==2.22.0 -url-normalize==1.4.1 \ No newline at end of file +beautifulsoup4==4.9.3 +ntlm-auth==1.5.0 +python-dateutil==2.8.2 +requests==2.26.0 +requests-toolbelt==0.9.1 +requests_ntlm==1.1.0 +six==1.16.0 +url-normalize==1.4.3 +ujson==4.1.0 From bee1ff7b1c7fdff23fa28a622b2b7cfcbb043ac5 Mon Sep 17 00:00:00 2001 From: Sam Sciolla Date: Tue, 7 Sep 2021 17:05:49 -0400 Subject: [PATCH 2/2] Tweak .dockerignore and requirements.txt --- .dockerignore | 3 +-- requirements.txt | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.dockerignore b/.dockerignore index 9127f11..8f69b8e 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ **/env.json - +**/__pycache__ venv -__pycache__ diff --git a/requirements.txt b/requirements.txt index ac407c1..a01d603 100644 --- a/requirements.txt +++ b/requirements.txt @@ -8,5 +8,5 @@ requests==2.26.0 requests-toolbelt==0.9.1 requests_ntlm==1.1.0 six==1.16.0 -url-normalize==1.4.3 ujson==4.1.0 +url-normalize==1.4.3