Skip to content
Snippets Groups Projects
Commit f674ac09 authored by David Schmitz's avatar David Schmitz Committed by Ihr Name
Browse files

fixed debian FoD container and also allow for 2step container building

parent a0a17ca5
No related branches found
No related tags found
No related merge requests found
FROM debian:buster
ENV LC_ALL en_US.utf8
RUN apt-get update
RUN echo "Set up container's locales"
RUN echo -e 'LANG="en_US.UTF-8"\nLANGUAGE="en_US"\n' > /etc/default/locale
RUN echo "en_US.utf8 UTF-8" >> /etc/locale.gen
RUN apt-get -qqy install locales
RUN mkdir -p /var/log/fod /srv
#COPY . /srv/flowspy
COPY install-debian.sh requirements.txt /srv/flowspy/
RUN apt-get -qqy install patch
#RUN (cd /srv/flowspy; ./install-debian.sh;)
RUN (cd /srv/flowspy; ./install-debian.sh --basesw;)
#EXPOSE 8000
#CMD [ "/srv/flowspy/runfod.sh" ]
CMD [ "sleep" "10000000" ]
#FROM debian:buster
FROM fodpy3-debian_base
ENV LC_ALL en_US.utf8
RUN apt-get update
RUN echo "Set up container's locales"
RUN echo -e 'LANG="en_US.UTF-8"\nLANGUAGE="en_US"\n' > /etc/default/locale
RUN echo "en_US.utf8 UTF-8" >> /etc/locale.gen
RUN apt-get -qqy install locales
RUN mkdir -p /var/log/fod /srv
COPY . /srv/flowspy
RUN apt-get -qqy install patch
RUN (cd /srv/flowspy/flowspy && cp -f settings.py.dist settings.py && patch settings.py < settings.py.patch && touch settings_local.py;)
#RUN (cd /srv/flowspy; bash ./install-debian.sh;)
RUN (cd /srv/flowspy; ./install-debian.sh --fodproper;)
EXPOSE 8000
WORKDIR /srv/flowspy
CMD [ "/srv/flowspy/runfod.sh" ]
set -e
echo "Install dependencies"
apt-get -qqy update
apt-get -qqy install python3-virtualenv python3-venv python3-setuptools \
python3-dev vim git build-essential libevent-dev libxml2-dev libxslt1-dev \
mariadb-server libmariadb-dev patch redis-server
echo "Setup python environment for FoD"
mkdir -p /var/log/fod /srv
pyvenv /srv/venv
(
#!/bin/bash
#
# This script installs all dependencies for Firewall-on-Demand running in Python3
# with Celery, Redis, and sqlite.
#
install_basesw=1
install_fodproper=1
if [ $# -ge 1 -a "$1" = "--both" ]; then
shift 1
install_basesw=1
install_fodproper=1
elif [ $# -ge 1 -a "$1" = "--basesw" ]; then
shift 1
install_basesw=1
install_fodproper=0
elif [ $# -ge 1 -a "$1" = "--fodproper" ]; then
shift 1
install_basesw=0
install_fodproper=1
fi
##
if [ "$install_basesw" = 1 ]; then
set -e
echo "Install dependencies"
apt-get -qqy update
apt-get -qqy install python3-virtualenv python3-venv python3-setuptools \
python3-dev vim git build-essential libevent-dev libxml2-dev libxslt1-dev \
mariadb-server libmariadb-dev patch redis-server \
rustc libssl-dev \
procps
set +e
fi
if [ "$install_fodproper" = 0 ]; then
echo "Setup partial python environment for FoD"
mkdir -p /srv
pyvenv /srv/venv
source /srv/venv/bin/activate
pip install wheel
pip install -r requirements.txt
else
echo "Setup python environment for FoD"
mkdir -p /var/log/fod /srv
pyvenv /srv/venv
(
set +e
source /srv/venv/bin/activate
mkdir -p /srv/flowspy/
# Select source dir and copy FoD into /srv/flowspy/
if [ "`basename "$0"`" = install-debian.sh ]; then
if [ "`basename "$0"`" = install-centos.sh ]; then
# this script is in the source directory
cp -f -r "`dirname $0`"/* /srv/flowspy/
elif [ -e /vagrant ]; then
# vagrant's copy in /vagrant/
cp -f -r /vagrant/* /srv/flowspy/
elif [ -e ./install-debian.sh ]; then
elif [ -e ./install-centos.sh ]; then
# current directory is with the sourcecode
cp -f -r ./* /srv/flowspy/
else
......@@ -37,12 +81,19 @@ pyvenv /srv/venv
cp -f settings.py.dist settings.py
patch settings.py < settings.py.patch
)
pip install wheel
pip install -r requirements.txt
touch flowspy/settings_local.py
./manage.py collectstatic
#./manage.py syncdb --noinput
mkdir -p /srv/flowspy/static/
./manage.py collectstatic --noinput
./manage.py migrate
./manage.py loaddata initial_data
)
)
set +e
fi
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment