derbynet
derbynet copied to clipboard
How to get a working installation from a cloned repository
I am bringing the discussion from https://github.com/jeffpiazza/derbynet/issues/203#issuecomment-1891098918 here.
I am on Windows, but I nominally seem to have it running with:
docker run -d -p 80:80 -p443:443 -v c:\users\theid\source\sandbox\derbynet\lib\:/var/lib/derbynet --mount type=bind,src=c:\users\theid\source\sandbox\derbynet\website\,target=/var/www/html,readonly jeffpiazza/derbynet_server
However, I don't get very far as I get a 500
because of
2024/01/15 14:18:54 [error] 18#18: *6 FastCGI sent in stderr: "PHP message: PHP Warning: require_once(inc/banner.inc): Failed to open stream: No such file or directory in /var/www/html/setup.php on line 4; PHP message: PHP Fatal error: Uncaught Error: Failed opening required 'inc/banner.inc' (include_path='.:/usr/share/php82') in /var/www/html/setup.php:4
Stack trace:
#0 {main}
thrown in /var/www/html/setup.php on line 4" while reading response header from upstream, client: 172.17.0.1, server: _, request: "GET /setup.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php-fpm.sock:", host: "localhost"
Looking at the repository, it does seem like that file does not exist.
Is this something that ant may generate? That is a separate rabbit hole for me to go in, as I don't have Java installed.
That was it, I believe. I was able to quickly load ant by using WSL.
I used:
sudo apt-get update
sudo apt-get install ant
I did get some errors, but the setup page loads
ant generated
Buildfile: /mnt/c/Users/theid/source/sandbox/derbynet/build.xml
release-series:
banner:
[copy] Copying 1 file to /mnt/c/Users/theid/source/sandbox/derbynet/website/inc
generated-version.inc:
generated-build-date.inc:
generated-commit-hash.inc:
docs-dist:
make-dist-dir:
[mkdir] Created dir: /mnt/c/Users/theid/source/sandbox/derbynet/docs/dist
installation:
BUILD FAILED
I don't have time to do more right now, but I will update this thread as I progress
I didn't particularly want to install Java and Ant on my system, so I poked ChatGPT and ended up adding this Dockerfile to a new build
directory:
# From root of repo:
# docker build -t apache-ant -f build/Dockerfile .
# docker run --rm -v $(pwd):/workspace apache-ant ant generated
# Or, to run multiple ant commands,
# docker run -it --rm -v $(pwd):/workspace apache-ant
# [your commands]
# exit
# Contents below adapted from a ChatGPT response. Proceed with caution. :)
# Use a base image with Java 8 already installed
FROM openjdk:8-jdk
# Set environment variables
ENV ANT_VERSION 1.10.14
ENV ANT_HOME /opt/apache-ant-$ANT_VERSION
ENV PATH $PATH:$ANT_HOME/bin
# Install required packages
RUN apt-get update && \
apt-get install -y wget && \
rm -rf /var/lib/apt/lists/*
# Download and install Apache Ant
RUN wget -qO- https://downloads.apache.org/ant/binaries/apache-ant-$ANT_VERSION-bin.tar.gz | tar xvz -C /opt
# Set working directory
WORKDIR /workspace
I don't have LibreOffice installed, so I also needed to remove quickref
from the dependencies of generated
in build.xml
, and then I was up and running!