diff --git a/.forgejo/workflows/build-push.yml b/.forgejo/workflows/build-push.yml index 673d9cd..e0501f9 100644 --- a/.forgejo/workflows/build-push.yml +++ b/.forgejo/workflows/build-push.yml @@ -5,7 +5,7 @@ on: branches: - main - master - - 'ci/*' + - fix_robustness_dockerize_project tags: - 'v*' diff --git a/Dockerfile b/Dockerfile index 4e9a9a7..639045e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,18 +1,22 @@ +# Use official lightweight Python base image FROM python:3.11-slim +# Set working directory inside container WORKDIR /app -# Prevent Python from writing .pyc files & buffer stdout/stderr -ENV PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 \ - PORT=8000 \ - USER_AGENT="Phikipathia/1.0 (https://git.depeuter.dev/tdpeuter/2022ST-project-Phikipathia)" - +# Install Python dependencies first to leverage Docker layer caching COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt +# Copy application files COPY . . +# Expose default port EXPOSE 8000 +# Set default environment variables +ENV PORT=8000 +ENV USER_AGENT="Phikipathia/1.0 (Wikipedia Philosophy Path Visualizer; https://github.com/tdpeuter/2022ST-project-Phikipathia)" + +# Run Python HTTP server CMD ["python", "server.py"] diff --git a/cgi-bin/scraper.py b/cgi-bin/scraper.py index a7fe6ca..e48883e 100644 --- a/cgi-bin/scraper.py +++ b/cgi-bin/scraper.py @@ -18,7 +18,7 @@ import requests # Default HTTP User-Agent adhering to Wikimedia API policy DEFAULT_USER_AGENT = ( - "Phikipathia/1.0 (https://git.depeuter.dev/tdpeuter/2022ST-project-Phikipathia; contact@phikipathia.org)" + "Phikipathia/1.0 (https://github.com/tdpeuter/2022ST-project-Phikipathia; contact@phikipathia.org)" ) # Per-request HTTP timeout in seconds diff --git a/docker-compose.yml b/docker-compose.yml index 57d3d5c..37a64e3 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,7 +10,7 @@ services: - "${PORT:-8000}:8000" environment: - PORT=8000 - - USER_AGENT=${USER_AGENT:-Phikipathia/1.0 (https://git.depeuter.dev/tdpeuter/2022ST-project-Phikipathia)} + - USER_AGENT=${USER_AGENT:-Phikipathia/1.0 (https://github.com/tdpeuter/2022ST-project-Phikipathia)} healthcheck: test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/\")'"] interval: 30s diff --git a/index.html b/index.html index 48ee37d..388cda4 100644 --- a/index.html +++ b/index.html @@ -22,12 +22,7 @@
- +
@@ -84,10 +79,6 @@ bij filosofie uitkomt. Lees er hier meer over.

- © 2022 Tibo De Peuter diff --git a/index.js b/index.js index 9351740..7059da0 100644 --- a/index.js +++ b/index.js @@ -357,10 +357,7 @@ function init() { if (toevoegKnop) toevoegKnop.addEventListener('click', zoek); if (wisKnop) wisKnop.addEventListener('click', clearTree); - if (taal) { - taal.addEventListener('input', inputWaarschuwing); - taal.addEventListener('change', inputWaarschuwing); - } + if (taal) taal.addEventListener('input', inputWaarschuwing); if (einde) einde.addEventListener('input', inputWaarschuwing); if (errorDismiss) errorDismiss.addEventListener('click', hideError); diff --git a/style.css b/style.css index bd84e7a..b7566d6 100644 --- a/style.css +++ b/style.css @@ -101,18 +101,16 @@ main > .box:first-child { gap: 4px; } -.form-group input[type="text"], -.form-group select { +.form-group input[type="text"] { padding: 3px 6px; border: 1px solid #a2a9b1; border-radius: 2px; font-size: 0.95em; font-family: sans-serif; - background-color: #ffffff; } #taal { - min-width: 9em; + width: 3.5em; } #start, #einde {