Docker: run dev build of site in docker

This commit is contained in:
eyedeekay
2024-07-19 12:54:56 -04:00
parent 00fe06b76b
commit 5603a46043
7 changed files with 18 additions and 63 deletions

View File

@ -0,0 +1,2 @@
docker-run-dev.sh
site-updater-docker.sh

View File

@ -18,6 +18,7 @@ RUN rm -rfv env && \
. env/bin/activate && \
pip install -r etc/reqs.txt && \
patch -p0 -N -r - <etc/multi-domain.patch && \
cp -rv env ../env && \
./compile-messages.sh && \
echo "Git revision: $(git log -n 1 | grep commit | sed 's/commit //' | sed 's/ .*$//')" | tee ./i2p2www/pages/include/mtnversion && \
## We've now updated the site
@ -37,4 +38,4 @@ RUN rm -rfv env && \
sed -i 's|IncludeOptional sites-enabled|# IncludeOptional sites-enabled|g' /etc/apache2/apache2.conf && \
sed -i '1 i\IncludeOptional sites-enabled/i2p.conf' /etc/apache2/apache2.conf
CMD service apache2 restart && tail -f /var/log/apache2/access.log
CMD service apache2 restart && tail -f /var/log/apache2/access.log /var/log/apache2/error.log

View File

@ -1,56 +1,3 @@
#! /usr/bin/env bash
## Set additional docker run arguments by changing the variable
## i2p_www_docker_run_args in an optional file called config.sh
## for example
##
##i2p_www_docker_run_args='-d'
## to run the site in the background, or
##
##i2p_www_docker_run_args='-t'
## to emulate a TTY
## To operate a quick and easy mirror of the I2P Site in a container
## simply clone the i2p.www source to a host with Docker installed, then
## add:
##
##i2p_www_docker_run_args='-d'
## to config.sh
##
## Then add:
##
##*/10 * * * * /path/to/i2p.www/site-updater-docker.sh
##
## to a crontab belonging to a member of the `docker` group. To add yourself
## to the `docker` group use the command:
##
##sudo adduser $(whoami) docker
##
## a more secure solution may be to create a user especially to run the
## docker crontab only, who is a member of the docker group. To do this,
##
##sudo adduser --disabled-password --disabled-login --ingroup docker docker
## however the specifics may vary from distribution to distribution.
dir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
if [ -f "${dir}/config.sh" ]; then
. "${dir}/config.sh"
fi
if [ -z $port ]; then
port="8090"
fi
if [ -z $i2p_www_branch ]; then
i2p_www_branch=master
fi
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" || exit
cd "$DIR" || exit
git pull origin $i2p_www_branch
docker build $i2p_www_docker_build_args -t mirror.i2p.www$suffix .
docker rm -f mirror.i2p.www$suffix
docker run -it $i2p_www_docker_run_args --env DEV:on --name mirror.i2p.www$suffix --net=host --volume $(pwd)/env:/env mirror.i2p.www$suffix ./runserver.py
docker logs -f mirror.i2p.www$suffix
export devmode="--volume $(pwd):/var/www/i2p.www"
./site-updater-docker.sh runserver.sh

View File

@ -3,5 +3,5 @@ export spec=""
export venv="`which virtualenv-2.7`"
if [ x"$venv" = x ]; then
export venv="`which virtualenv`"
export spec="-p 2.7"
#export spec="-p 2.7"
fi

View File

@ -59,4 +59,9 @@ __ http://{{ i2pconv('git.idk.i2p') }}/i2p-hackers/i2p.i2p/-/issues?scope=all&st
::
sum file
13f2e6b3cc9716c89c4d4d3bc9918171fbad5f450171e1c32b1237b5421bc065 i2pinstall_2.6.0_windows.exe
42ac34e4c67cf5e2582853f0cf3074f6a73ea59503e1350e1b687cee3f849814 i2pinstall_2.6.0_windows.exe.sig
24cda3f04e8c2e976b73bd45d36d0e31217e28fbe3019bf9a9d839b45d60537a i2pinstall_2.6.0.jar
249b35c1e061e194ee18048b0644cc5e2c5cf785ffce655e3124eb959dc189ff i2psource_2.6.0.tar.bz2
2867d752f6fb89a7a5ada4f4123ca601ad8d78ff78f553a9269bf0ddffe724ca i2pupdate_2.6.0.zip
be6ac988497ac0336d21cdfc57bbbe3cc5cffd983ac3282fd8ea11914e18e7ee i2pupdate.su3

View File

@ -1,7 +1,7 @@
{% set i2pinstall_windows_hash = '1aa1ac29620886a7d744424318287c67dc9ead488e6ab434848597ee9db7ce18' %}
{% set i2pinstall_jar_hash = '751f48cfb380c8796bd645621b149114d55f32cd4330784cb287be9413b02569' %}
{% set i2psource_hash = 'f23d0746d72a55cccbd17f40762e491ae1b42cdf55d7e73404d213a84985ca73' %}
{% set i2pupdate_hash = 'adba8b7512d27a44ed876ec4beb39a82ebb34dc243ec024aff289e91823fc0c7' %}
{% set i2pinstall_windows_hash = '13f2e6b3cc9716c89c4d4d3bc9918171fbad5f450171e1c32b1237b5421bc065' %}
{% set i2pinstall_jar_hash = '24cda3f04e8c2e976b73bd45d36d0e31217e28fbe3019bf9a9d839b45d60537a' %}
{% set i2psource_hash = '249b35c1e061e194ee18048b0644cc5e2c5cf785ffce655e3124eb959dc189ff' %}
{% set i2pupdate_hash = '2867d752f6fb89a7a5ada4f4123ca601ad8d78ff78f553a9269bf0ddffe724ca' %}
{% set i2p_android_hash = '272acf543c4489dc3775c07c42eb91710b4ed377c78aff605e3d44e73fad5110' %}
{% set i2p_macnative_hash = '18cb22cfcc3cbe0cec150e89a394d1a35703cb508ed627ef48084b7ba7c90dde' %}

View File

@ -52,4 +52,4 @@ cd "$DIR" || exit
git pull origin $i2p_www_branch
docker build $i2p_www_docker_build_args -t mirror.i2p.www$suffix .
docker rm -f mirror.i2p.www$suffix
docker run $i2p_www_docker_run_args --name mirror.i2p.www$suffix -p 0.0.0.0:$port:80 mirror.i2p.www$suffix $@
docker run -it $i2p_www_docker_run_args --name mirror.i2p.www$suffix -p 127.0.0.1:5000:5000 -p 0.0.0.0:$port:80 $devmode mirror.i2p.www$suffix $@