summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Containerfile46
1 files changed, 46 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile
new file mode 100644
index 0000000..acefff1
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,46 @@
+# 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.
+
+#
+FROM ghcr.io/astral-sh/uv:python3.13-bookworm
+WORKDIR /EXPO
+
+USER root
+RUN apt update && \
+ apt-get install sqlite3 survex rsync -y && \
+ useradd -m expopod -G sudo -s /bin/bash
+
+
+# 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"
+RUN git config --global pull.rebase true
+
+RUN cd troggle && uv run databaseReset.py reset INIT
+
+EXPOSE 8080
+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