Compare commits
4 commits
3901db9f76
...
afeb502b8e
| Author | SHA1 | Date | |
|---|---|---|---|
| afeb502b8e | |||
| b72ad44318 | |||
| ebbbe9fe21 | |||
| 4bc661c7c7 |
7 changed files with 17 additions and 27 deletions
|
|
@ -5,7 +5,7 @@ on:
|
||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
- master
|
- master
|
||||||
- 'ci/*'
|
- fix_robustness_dockerize_project
|
||||||
tags:
|
tags:
|
||||||
- 'v*'
|
- 'v*'
|
||||||
|
|
||||||
|
|
|
||||||
16
Dockerfile
16
Dockerfile
|
|
@ -1,18 +1,22 @@
|
||||||
|
# Use official lightweight Python base image
|
||||||
FROM python:3.11-slim
|
FROM python:3.11-slim
|
||||||
|
|
||||||
|
# Set working directory inside container
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Prevent Python from writing .pyc files & buffer stdout/stderr
|
# Install Python dependencies first to leverage Docker layer caching
|
||||||
ENV PYTHONDONTWRITEBYTECODE=1 \
|
|
||||||
PYTHONUNBUFFERED=1 \
|
|
||||||
PORT=8000 \
|
|
||||||
USER_AGENT="Phikipathia/1.0 (https://git.depeuter.dev/tdpeuter/2022ST-project-Phikipathia)"
|
|
||||||
|
|
||||||
COPY requirements.txt .
|
COPY requirements.txt .
|
||||||
RUN pip install --no-cache-dir -r requirements.txt
|
RUN pip install --no-cache-dir -r requirements.txt
|
||||||
|
|
||||||
|
# Copy application files
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|
||||||
|
# Expose default port
|
||||||
EXPOSE 8000
|
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"]
|
CMD ["python", "server.py"]
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ import requests
|
||||||
|
|
||||||
# Default HTTP User-Agent adhering to Wikimedia API policy
|
# Default HTTP User-Agent adhering to Wikimedia API policy
|
||||||
DEFAULT_USER_AGENT = (
|
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
|
# Per-request HTTP timeout in seconds
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ services:
|
||||||
- "${PORT:-8000}:8000"
|
- "${PORT:-8000}:8000"
|
||||||
environment:
|
environment:
|
||||||
- PORT=8000
|
- 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:
|
healthcheck:
|
||||||
test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/\")'"]
|
test: ["CMD-SHELL", "python -c 'import urllib.request; urllib.request.urlopen(\"http://localhost:8000/\")'"]
|
||||||
interval: 30s
|
interval: 30s
|
||||||
|
|
|
||||||
11
index.html
11
index.html
|
|
@ -22,12 +22,7 @@
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="taal">Taal: </label>
|
<label for="taal">Taal: </label>
|
||||||
<select id="taal">
|
<input type="text" id="taal" placeholder="en" autocomplete="off" />
|
||||||
<option value="en" selected>en (English)</option>
|
|
||||||
<option value="nl">nl (Nederlands)</option>
|
|
||||||
<option value="fr">fr (Français)</option>
|
|
||||||
<option value="de">de (Deutsch)</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="start">Startpagina: </label>
|
<label for="start">Startpagina: </label>
|
||||||
|
|
@ -84,10 +79,6 @@
|
||||||
bij <a href="https://en.wikipedia.org/wiki/Philosophy" target="_blank" rel="noopener">filosofie</a> uitkomt. Lees er
|
bij <a href="https://en.wikipedia.org/wiki/Philosophy" target="_blank" rel="noopener">filosofie</a> uitkomt. Lees er
|
||||||
<a href="https://en.wikipedia.org/wiki/Wikipedia:Getting_to_Philosophy" target="_blank" rel="noopener">hier</a> meer over.
|
<a href="https://en.wikipedia.org/wiki/Wikipedia:Getting_to_Philosophy" target="_blank" rel="noopener">hier</a> meer over.
|
||||||
</p>
|
</p>
|
||||||
<p class="footer-meta">
|
|
||||||
Code bijgewerkt in 2026. Originele baseline:
|
|
||||||
<a href="https://git.depeuter.dev/tdpeuter/2022ST-project-Phikipathia/src/commit/5ed9fdf2c1eb71068a08256fd4bc46f47b7f1889" target="_blank" rel="noopener">bekijk originele code (commit 5ed9fdf)</a>.
|
|
||||||
</p>
|
|
||||||
<small>© 2022 Tibo De Peuter</small>
|
<small>© 2022 Tibo De Peuter</small>
|
||||||
</footer>
|
</footer>
|
||||||
|
|
||||||
|
|
|
||||||
5
index.js
5
index.js
|
|
@ -357,10 +357,7 @@
|
||||||
function init() {
|
function init() {
|
||||||
if (toevoegKnop) toevoegKnop.addEventListener('click', zoek);
|
if (toevoegKnop) toevoegKnop.addEventListener('click', zoek);
|
||||||
if (wisKnop) wisKnop.addEventListener('click', clearTree);
|
if (wisKnop) wisKnop.addEventListener('click', clearTree);
|
||||||
if (taal) {
|
if (taal) taal.addEventListener('input', inputWaarschuwing);
|
||||||
taal.addEventListener('input', inputWaarschuwing);
|
|
||||||
taal.addEventListener('change', inputWaarschuwing);
|
|
||||||
}
|
|
||||||
if (einde) einde.addEventListener('input', inputWaarschuwing);
|
if (einde) einde.addEventListener('input', inputWaarschuwing);
|
||||||
if (errorDismiss) errorDismiss.addEventListener('click', hideError);
|
if (errorDismiss) errorDismiss.addEventListener('click', hideError);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,18 +101,16 @@ main > .box:first-child {
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.form-group input[type="text"],
|
.form-group input[type="text"] {
|
||||||
.form-group select {
|
|
||||||
padding: 3px 6px;
|
padding: 3px 6px;
|
||||||
border: 1px solid #a2a9b1;
|
border: 1px solid #a2a9b1;
|
||||||
border-radius: 2px;
|
border-radius: 2px;
|
||||||
font-size: 0.95em;
|
font-size: 0.95em;
|
||||||
font-family: sans-serif;
|
font-family: sans-serif;
|
||||||
background-color: #ffffff;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#taal {
|
#taal {
|
||||||
min-width: 9em;
|
width: 3.5em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#start, #einde {
|
#start, #einde {
|
||||||
|
|
|
||||||
Reference in a new issue