summaryrefslogtreecommitdiffstats
path: root/Containerfile
diff options
context:
space:
mode:
Diffstat (limited to 'Containerfile')
-rw-r--r--Containerfile83
1 files changed, 54 insertions, 29 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