From 46e065a9269649cd9c9674ca41b072b063702017 Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 8 Dec 2025 18:48:45 -0500 Subject: [PATCH 1/2] okay fixed docker file to listen on correct port --- .gitignore | 2 ++ Dockerfile | 4 ++-- README.md | 27 ++++++++++++++------------- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/.gitignore b/.gitignore index 34e7ff6..3650e29 100644 --- a/.gitignore +++ b/.gitignore @@ -139,3 +139,5 @@ dmypy.json .pyre/ # End of https://www.gitignore.io/api/macos,python + +.env diff --git a/Dockerfile b/Dockerfile index 60aa87d..f600f51 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN pip install --no-cache-dir -r requirements.txt COPY jumpstart jumpstart -EXPOSE 5000 +EXPOSE 8080 RUN useradd jumpstart RUN chown jumpstart /usr/local/jumpstart @@ -14,4 +14,4 @@ RUN mkdir -p /usr/local/var RUN chown jumpstart:jumpstart /usr/local/var USER jumpstart -CMD ["gunicorn", "jumpstart:app"] +CMD ["sh", "-c", "gunicorn jumpstart:app --bind=0.0.0.0:8080 --access-logfile - --error-log - --capture-output --timeout=600"] diff --git a/README.md b/README.md index 7a86370..3d0a4a6 100644 --- a/README.md +++ b/README.md @@ -9,21 +9,19 @@ See it live [here](https://jumpstart.csh.rit.edu)! This project uses [Python](http://nodejs.org), [Flask](https://npmjs.com), SQL, HTML/CSS, and Javascript. 1. Clone and cd into the repo: `git clone https://github.com/ComputerScienceHouse/Jumpstart` -2. Run `pip install -r requirements.txt` +2. Run `pip install -r requirements.txt` (or use docker) 3. Ask opcomm for secrets - - The secrets package follows the directory structure: - src/ - secrets/ - client_secrets.json -4. Run `flask --app jumpstart run` + - Google clients secret json + - Jumpstart API keys (runs without this... not entirely sure what it does) +4. Run `flask --app jumpstart run` (please use docker) 5. Results Jumpstart expects the following environment variables to be defined: ``` -FLASK_APP=jumpstart:App JUMPSTART_API_KEYS=KEYS TZ=TIMEZONE SENTRY_DSN=LINK +GOOGLE_CLIENT_SECERTS_JSON=json from key file ``` ## Docker @@ -31,13 +29,16 @@ SENTRY_DSN=LINK 2. Run with the following: (Be sure to update env variables) ``` docker run \ - -e FLASK_RUN_HOST=0.0.0.0 \ - -e FLASK_APP=jumpstart:App \ -e JUMPSTART_API_KEYS=KEYS \ -e TZ=America/New_York \ -e SENTRY_DSN=LINK \ - -e GUNICORN_CMD_ARGS="-b=0.0.0.0:5000" \ - -v ./secrets:/usr/local/jumpstart/secrets \ - -p 5000:5000 \ + -p 8080:8080 \ jumpstart -``` \ No newline at end of file +``` +3. You can also use a `.env` file: +``` +docker run \ + --env-file='.env' + -p 8080:8080 + jumpstart +``` From 546d7ac2545eef1efe9f6a4212559406a1800abb Mon Sep 17 00:00:00 2001 From: Noah Date: Mon, 8 Dec 2025 19:11:23 -0500 Subject: [PATCH 2/2] update readme and add example env file --- .env.example | 7 +++++++ README.md | 17 +++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..8a0ea38 --- /dev/null +++ b/.env.example @@ -0,0 +1,7 @@ +# For authenticating slack bot +JUMPSTART_API_KEYS= + +TZ=America/New_York + +# Don't need for local development +SENTRY_DSN= diff --git a/README.md b/README.md index 3d0a4a6..324fd53 100644 --- a/README.md +++ b/README.md @@ -12,16 +12,19 @@ This project uses [Python](http://nodejs.org), [Flask](https://npmjs.com), SQL, 2. Run `pip install -r requirements.txt` (or use docker) 3. Ask opcomm for secrets - Google clients secret json - - Jumpstart API keys (runs without this... not entirely sure what it does) + - The secrets package follows the directory structure: + src/ + secrets/ + client_secrets.json + - Jumpstart API keys 4. Run `flask --app jumpstart run` (please use docker) 5. Results Jumpstart expects the following environment variables to be defined: ``` -JUMPSTART_API_KEYS=KEYS +JUMPSTART_API_KEYS=KEYS # For authenticating slack bot TZ=TIMEZONE -SENTRY_DSN=LINK -GOOGLE_CLIENT_SECERTS_JSON=json from key file +SENTRY_DSN=LINK # Don't need for local development ``` ## Docker @@ -33,12 +36,14 @@ docker run \ -e TZ=America/New_York \ -e SENTRY_DSN=LINK \ -p 8080:8080 \ + -v ./secrets:/usr/local/jumpstart/secrets \ jumpstart ``` 3. You can also use a `.env` file: ``` docker run \ - --env-file='.env' - -p 8080:8080 + --env-file='.env' \ + -p 8080:8080 \ + -v ./secrets:/usr/local/jumpstart/secrets \ jumpstart ```