diff --git a/Dockerfile b/Dockerfile index 1cac8bc..e318ef0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,10 +1,10 @@ # Dockerfile for Expungement Generator's frontend. -FROM php:7.2-apache-stretch +FROM php:8.1-apache-bullseye RUN apt-get update && \ apt-get upgrade -y && \ - apt-get install -y git nano wget python2.7 libfontconfig poppler-utils cron zlib1g-dev nano unattended-upgrades apt-listchanges && \ + apt-get install -y git nano wget python2.7 libfontconfig poppler-utils cron zlib1g-dev nano unattended-upgrades apt-listchanges libzip-dev && \ ln -s /usr/bin/pdftotext /usr/local/bin/pdftotext RUN cd /usr/local/include && \ diff --git a/Expungement-Generator/helpers/docketsearch_api.php b/Expungement-Generator/helpers/docketsearch_api.php index 0868453..d8ca6ad 100644 --- a/Expungement-Generator/helpers/docketsearch_api.php +++ b/Expungement-Generator/helpers/docketsearch_api.php @@ -15,8 +15,7 @@ // the search. function docketNameSearch($firstName, $lastName, $dob) { global $docketScraperAPIURL; - $ch = curl_init($docketScraperAPIURL . "/" . - "ujs/search/name/"); + $ch = curl_init($docketScraperAPIURL . "/ujs/search/name/"); $jsonData = array( "first_name" => $firstName, "last_name" => $lastName diff --git a/Expungement-Generator/manage.php b/Expungement-Generator/manage.php index fb4b1c5..b036dc8 100644 --- a/Expungement-Generator/manage.php +++ b/Expungement-Generator/manage.php @@ -279,4 +279,4 @@ function displayAllOrgs() $result->close(); print ""; } -?> \ No newline at end of file +?> diff --git a/Expungement-Generator/templates/791SealingTemplate.docx b/Expungement-Generator/templates/791SealingTemplate.docx index 76a4fbd..abebf74 100644 Binary files a/Expungement-Generator/templates/791SealingTemplate.docx and b/Expungement-Generator/templates/791SealingTemplate.docx differ diff --git a/Makefile b/Makefile index 96282c2..7f063ce 100644 --- a/Makefile +++ b/Makefile @@ -8,8 +8,8 @@ endif .PHONY: docker docker: - docker build -f Dockerfile --tag ${REPOSITORY}/${IMAGENAME}:${TAG} https://github.com/NateV/Expungement-Generator.git\#main - docker build -f db_dockerfile --tag ${REPOSITORY}/${IMAGENAME}_db:${TAG} https://github.com/NateV/Expungement-Generator.git\#main + docker build -f Dockerfile --platform=linux/amd64 --tag ${REPOSITORY}/${IMAGENAME}:${TAG} . + docker build -f db_dockerfile --platform=linux/amd64 --tag ${REPOSITORY}/${IMAGENAME}_db:${TAG} . .PHONY: push push: diff --git a/README.md b/README.md index 894ae28..dd4b1cf 100644 --- a/README.md +++ b/README.md @@ -98,6 +98,20 @@ However, if your instance of the EG has users from multiple organizations, only If a guest organization needs to record their expungements, they should host their own instance of the EG. +### Deploying + +You will need to have a `.env` file with the variables: + +``` +REPOSITORY= +IMAGENAME= +TAG= +SECRET_KEY= + +``` + +Once you have those with their respective values. You will need to run `make docker` and `make push` to build and push to the container registry. + ## Motivation Expungements are the most effective way to help an individual with a criminal record to find employment. It is near impossible to find decent work if you have a record that is visible to the world. Expungements are both time consuming and require the attention of a lawyer to properly prepare. But they are also very boring for lawyers to prepare. In an organization like CLS where we prepare thousands of expungement petitions a year, it is critical to speed up the process and remove much of the rote work from the lawyers working on expungements. The EG does both of those things. I am currently working on EG 2.0, which will be more accessible to non-lawyer petitioners. diff --git a/conf.d/disable_strict_mode.cnf b/conf.d/disable_strict_mode.cnf index 19eb273..52f07de 100644 --- a/conf.d/disable_strict_mode.cnf +++ b/conf.d/disable_strict_mode.cnf @@ -1,2 +1,2 @@ [mysqld] -sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION +sql_mode=IGNORE_SPACE,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION diff --git a/db_dockerfile b/db_dockerfile index 87f77fb..11f5622 100644 --- a/db_dockerfile +++ b/db_dockerfile @@ -1,6 +1,7 @@ -FROM mysql:5.7 +FROM mysql:9.5.0 -RUN apt-get update && apt-get install -y unattended-upgrades apt-listchanges +RUN microdnf update +RUN microdnf upgrade -y COPY conf.d/disable_strict_mode.cnf /etc/mysql/conf.d/disable_strict_mode.cnf diff --git a/eg-compose.yml b/eg-compose.yml index a7ed606..88914f7 100644 --- a/eg-compose.yml +++ b/eg-compose.yml @@ -20,7 +20,7 @@ services: DB_USER: eg_user DB_PASS: somerandompassword SENDGRID_KEY: somerandomkey - docketscaperAPIURL: "docketscraper_api" + docketscaperAPIURL: "https://recoscope-d4157e2ccc9b.herokuapp.com/api/ujs" networks: - eg-net ports: @@ -28,6 +28,7 @@ services: volumes: - type: mount target: /data + platform: linux/amd64 db: image: eg_db # or natev/eg-docker-db:latest build: @@ -43,6 +44,7 @@ services: - eg-net expose: - "3306" + platform: linux/amd64 docketscraper_api: image: "natev/docketscraper_api" restart: always @@ -50,5 +52,6 @@ services: - eg-net expose: - "8800" + platform: linux/amd64 networks: eg-net: diff --git a/local-dev-compose.yml b/local-dev-compose.yml index f9d441f..cc21a18 100644 --- a/local-dev-compose.yml +++ b/local-dev-compose.yml @@ -44,7 +44,7 @@ services: expose: - "3306" docketscraperapi: - image: "${REPOSITORY}/eg-docketscraper:v2.0.0" + image: "${REPOSITORY}/eg-docketscraper:v2.0.1" restart: always environment: GUNICORN_LOGGER: "true"