summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Containerfile83
-rw-r--r--templates/logbookform.html5
2 files changed, 57 insertions, 31 deletions
diff --git a/Containerfile b/Containerfile
index acefff1..c771b40 100644
--- a/Containerfile
+++ b/Containerfile
@@ -1,46 +1,71 @@
-# Containerfile originally created by MS Copilot 1st July 2025
-# hand edited Philip Sargent
-# move this to the directory above troggle, loser etc before running it.
+# create an oci container image with
+# cd /home/expo && podman build -t expo:dev --rm -f troggle/Containerfile
#
-FROM ghcr.io/astral-sh/uv:python3.13-bookworm
-WORKDIR /EXPO
+FROM docker.io/library/debian:bookworm
+
+WORKDIR /home/expo2
-USER root
RUN apt update && \
- apt-get install sqlite3 survex rsync -y && \
- useradd -m expopod -G sudo -s /bin/bash
+ apt install -y postgresql apache2 survex rsync git cgit proftpd \
+ python3 python3-django python3-pil python3-piexif \
+ python3-bs4 python3-unidecode python3-cryptography \
+ libjs-codemirror
+# do we need libjs-leaflet? libjs-sizzle? libjs-mgrs?
+# Install non-packaged dependencies
+# apt install CaveView and bins and libjs-proj4 from local repo/backports?
# Copy only the dependency files first
-COPY troggle/pyproject.toml troggle/uv.lock ./troggle/
-
-COPY expofiles/surveyscans/2018 /EXPO/expofiles/surveyscans/2018
-COPY expofiles/photos/2018/PhilipSargent/ /EXPO/expofiles/photos/2018/PhilipSargent
-COPY troggle /EXPO/troggle
-COPY expoweb /EXPO/expoweb
-COPY loser /EXPO/loser
-COPY drawings /EXPO/drawings
-RUN chown -R expopod:expopod .
-USER expopod
-
-# Install dependencies and Django
-RUN cd troggle && uv sync --frozen
-
-RUN git config --global user.email "expopod@potato.hut"
-RUN git config --global user.name "expopod"
+#wget troggle/pyproject.toml troggle/uv.lock
+#RUN wget troggle/pyproject.toml && uv sync --frozen
+
+RUN useradd -m expo -G sudo -s /bin/bash
+
+# Optional:install and configure BoE
+
+#add apache config, enable modules
+#configure postgres
+
+
+#Start up services for apache, proftpd, postgresql, cron?
+
+#end of system stage
+
+
+# User files - separate layer?
+RUN chown expo:expo .
+USER expo
+
+RUN mkdir -p repositories/git && cd repositories/git && \
+ git clone http://expo.survex.com/repositories/troggle/.git && \
+ git clone http://expo.survex.com/repositories/expoweb/.git && \
+ git clone http://expo.survex.com/repositories/loser/.git && \
+ git clone http://expo.survex.com/repositories/drawings/.git
+RUN ln -s repositories/git/troggle troggle && \
+ ln -s repositories/git/troggle expoweb && \
+ ln -s repositories/git/troggle loser && \
+ ln -s repositories/git/troggle drawings
+
+RUN git config --global user.email "expo@potato.hut"
+RUN git config --global user.name "expo"
RUN git config --global pull.rebase true
-RUN cd troggle && uv run databaseReset.py reset INIT
+#rsync -az expo.survex.com:expofiles expofiles
+#demo short version
+#rsync -az expo.survex.com:expofiles/surveyscans/2018 expofiles/surveyscans/2018
+#rsync -az expo.survex.com:expofiles/photos/2018/PhilipSargent/ expofiles/photos/2018/PhilipSargent
+
+#/bin/sh is missing at this point - why?
+RUN cd troggle && run databaseReset.py reset INIT
EXPOSE 8080
+#Run postres process
CMD ["uv", "run", "python", "troggle/manage.py", "runserver", "0.0.0.0:8080"]
CMD ["bash"]
# move this file to the directory above troggle, loser etc before running the podman image build command.
-# if this was used like this:
-# podman image build . --tag expo-01
-# run this image interactively with
-# podman run -it --network=host --rm expo-01 \ No newline at end of file
+# used image with:
+# podman run -it --network=host --rm expo:dev
diff --git a/templates/logbookform.html b/templates/logbookform.html
index b5a18a5..28a28c8 100644
--- a/templates/logbookform.html
+++ b/templates/logbookform.html
@@ -11,7 +11,7 @@
{% endif %}
<div align=center>
{% if date %}<p>Link to <em><a href="/logbookentry/{{date}}/{{slug}}#">this entry</a></em> &nbsp;&nbsp;{% endif %}
-&nbsp;&nbsp;<a href="/logreport/{{logbookentry.expedition.year}}">logbook report</a>&nbsp;&nbsp;
+&nbsp;&nbsp;<a href="/logreport/{{year}}">logbook report {{year}}</a>&nbsp;&nbsp;
<a href="/handbook/logbooks.html#form">How to use this form</a>
</div>
{% if save_bad %}
@@ -71,6 +71,7 @@
title="Place: cave name, or 'plateau', 'topcamp' "
{% if place %}value="{{place}}"{% else %}placeholder="basecamp" {% endif %}
required />
+<br>(If any cave is visited at all, put in the cave id and not 'plateau')
<br /><br />
<label for="title">Title</label>
<input {% if not user.username %} disabled{% endif %}
@@ -82,7 +83,7 @@
<textarea {% if not user.username %} disabled{% endif %}
rows="{% if textrows%}{{textrows}}{% else %}5{% endif %}" cols="70"
label = "" name = "text"
- required />{% if entry %}{{entry}}{% else %}We had a lot of fun...{% endif %}
+ required />{% if entry %}{{entry}}{% else %}We had a lot of fun in the rain...{% endif %}
</textarea>
<br>
[Type in text in <a href="/handbook/logbooks.html#form">Logbook HTML format</a>.]