diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..40af1f62 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,28 @@ +# Python Version 3.9 +FROM python:3.9 + +LABEL version="0.1.0" + +LABEL description="An automated text-mining tool written in Python to measure \ + the technical responsibility of students in computer science courses, being \ + used to analyze students' markdown reflection documents and five questions \ + survey based on Natural Language Processing in the Department of Computer \ + Science at Allegheny College." + +LABEL maintainer="Bennett Westfall, Andre Hance, Thomas Antle, Bailey Mastrascia" + +COPY . /gatorminer + +WORKDIR /gatorminer + +RUN set -e && echo "Installing Pipenv..." \ + && pip install pipenv \ + && echo "Installing dependencies..." \ + && pipenv install --dev --skip-lock \ + && echo "Installing SpaCy models..." \ + && pipenv run python -m spacy download en_core_web_sm \ + && pipenv run python -m spacy download en_core_web_md + +CMD ["pipenv", "run", "streamlit", "run", "streamlit_web.py"] + +EXPOSE 8501 diff --git a/README.md b/README.md index 894965a7..19557748 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,8 @@ [![codecov](https://codecov.io/gh/Allegheny-Ethical-CS/GatorMiner/branch/master/graph/badge.svg)](https://codecov.io/gh/Allegheny-Ethical-CS/GatorMiner) [![Built with spaCy](https://img.shields.io/badge/built%20with-spaCy-09a3d5.svg)](https://spacy.io) [![Built with Streamlit](https://img.shields.io/badge/built%20with-Streamlit-09a3d5.svg)](https://www.streamlit.io/) +[![Docker Build](https://github.com/BennyWestsyde/GatorMiner/actions/workflows/dockerbuild.yml/badge.svg)](https://github.com/BennyWestsyde/GatorMiner/actions/workflows/dockerbuild.yml) +![Docker Image Version (latest by date)](https://img.shields.io/docker/v/bennywestsyde/gatorminer?label=Last%20Built%20and%20Pushed) An automated text-mining tool written in Python to measure the technical responsibility of students in computer science courses, being used to analyze @@ -50,6 +52,20 @@ pipenv run python -m spacy download en_core_web_sm pipenv run python -m spacy download en_core_web_md ``` +Alternatively, run a Docker container with all necessary dependencies and Spacy models installed. + +Run the Docker container for Mac: + +```bash +sh scripts/docker_run.sh +``` + +Run the Docker container for Windows: + +```bash +sh scripts/docker_run.bat +``` + ## Web Interface GatorMiner is mainly developed on its web interface with [Streamlit](https://www.streamlit.io) diff --git a/docker_build.bat b/docker_build.bat new file mode 100644 index 00000000..af175b8e --- /dev/null +++ b/docker_build.bat @@ -0,0 +1,2 @@ +@echo [+] (Win_OS) Building Docker Container. +docker build -t gatorminer . diff --git a/docker_build.sh b/docker_build.sh new file mode 100644 index 00000000..71399d50 --- /dev/null +++ b/docker_build.sh @@ -0,0 +1,3 @@ +#!/bin/bash +printf "\n[+] (Mac) Building Docker Container" +docker build -t gatorminer . diff --git a/docker_run.bat b/docker_run.bat new file mode 100644 index 00000000..bc565322 --- /dev/null +++ b/docker_run.bat @@ -0,0 +1,2 @@ +@echo [+] (Win_OS) Running Docker Container. +docker container run --name devi -d -p 8501:8501 bennywestsyde/gatorminer && echo "\n\tYou can now view your Streamlit app in your browser.\n\n\tNetwork URL: http://localhost:8501 \n\tExternal URL: http://141.195.4.17:8501" \ No newline at end of file diff --git a/docker_run.sh b/docker_run.sh new file mode 100644 index 00000000..d3aecb91 --- /dev/null +++ b/docker_run.sh @@ -0,0 +1,6 @@ +#!/bin/bash +printf "\n[+] (Mac) Running Docker Container" +docker container run --name devi -d -p 8501:8501 bennywestsyde/gatorminer && echo "\n\tYou can now view your Streamlit app in your browser.\n\n\tNetwork URL: http://localhost:8501 \n\tExternal URL: http://141.195.4.17:8501" + +# Run gatorminer container from the local image +# docker run -it -d -p 8501:8501 gatorminer