forked from expo/troggle
Update initial containerfile to use official base debian image and work over network
This commit is contained in:
@@ -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
|
FROM docker.io/library/debian:bookworm
|
||||||
WORKDIR /EXPO
|
|
||||||
|
WORKDIR /home/expo2
|
||||||
|
|
||||||
USER root
|
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt-get install sqlite3 survex rsync -y && \
|
apt install -y postgresql apache2 survex rsync git cgit proftpd && \
|
||||||
useradd -m expopod -G sudo -s /bin/bash
|
python3 python3-django python3-pil python3-piexif && \
|
||||||
|
python3-bs4 python3-unidecode python3-cryptography && \
|
||||||
|
libjs-codemirror libjs-proj4
|
||||||
|
|
||||||
|
# do we need libjs-leaflet? libjs-sizzle? libjs-mgrs?
|
||||||
|
|
||||||
|
# Install non-packaged dependencies
|
||||||
|
# apt install CaveView and bins and from local repo
|
||||||
# Copy only the dependency files first
|
# Copy only the dependency files first
|
||||||
COPY troggle/pyproject.toml troggle/uv.lock ./troggle/
|
#wget troggle/pyproject.toml troggle/uv.lock
|
||||||
|
#RUN wget troggle/pyproject.toml && uv sync --frozen
|
||||||
|
|
||||||
COPY expofiles/surveyscans/2018 /EXPO/expofiles/surveyscans/2018
|
RUN useradd -m expo -G sudo -s /bin/bash
|
||||||
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
|
# Optional:install and configure BoE
|
||||||
RUN cd troggle && uv sync --frozen
|
|
||||||
|
|
||||||
RUN git config --global user.email "expopod@potato.hut"
|
#add apache config, enable modules
|
||||||
RUN git config --global user.name "expopod"
|
#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 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
|
EXPOSE 8080
|
||||||
|
#Run postres process
|
||||||
CMD ["uv", "run", "python", "troggle/manage.py", "runserver", "0.0.0.0:8080"]
|
CMD ["uv", "run", "python", "troggle/manage.py", "runserver", "0.0.0.0:8080"]
|
||||||
CMD ["bash"]
|
CMD ["bash"]
|
||||||
|
|
||||||
# move this file to the directory above troggle, loser etc before running the podman image build command.
|
# move this file to the directory above troggle, loser etc before running the podman image build command.
|
||||||
|
|
||||||
# if this was used like this:
|
# used image with:
|
||||||
# podman image build . --tag expo-01
|
# podman run -it --network=host --rm expo:dev
|
||||||
# run this image interactively with
|
|
||||||
# podman run -it --network=host --rm expo-01
|
|
||||||
|
|||||||
Reference in New Issue
Block a user