Last active
June 15, 2020 13:29
-
-
Save fgianoli/348bd9413f12582de663a5c0cebd6210 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install dependencies | |
# Install packages from GeoNode core | |
sudo apt install -y gdal-bin | |
sudo apt install -y python3-pip python3-dev python3-virtualenv python3-venv virtualenvwrapper | |
sudo apt install -y libxml2 libxml2-dev gettext | |
sudo apt install -y libxslt1-dev libjpeg-dev libpng-dev libpq-dev libgdal-dev libgdal20 | |
sudo apt install -y software-properties-common build-essential | |
sudo apt install -y git unzip gcc zlib1g-dev libgeos-dev libproj-dev | |
sudo apt install -y sqlite3 spatialite-bin libsqlite3-mod-spatialite | |
# Install Openjdk | |
sudo -i apt update | |
sudo apt install openjdk-8-jdk-headless default-jdk-headless -y | |
sudo update-java-alternatives --jre-headless --jre --set java-1.8.0-openjdk-amd64 | |
# Install VIM | |
sudo apt install -y vim | |
sudo apt update -y | |
sudo apt upgrade -y | |
sudo apt autoremove -y | |
sudo apt autoclean -y | |
sudo apt purge -y | |
sudo apt clean -y | |
sudo adduser geonode | |
sudo usermod -aG sudo geonode | |
su geonode | |
## Install Docker http://docs.geonode.org/en/master/install/core/docker/ubuntu.html | |
sudo add-apt-repository universe | |
sudo apt-get update -y | |
sudo apt-get install -y git-core git-buildpackage debhelper devscripts | |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | |
sudo apt-get update -y | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose | |
sudo apt autoremove --purge | |
## To check if docker is correctly installed run the command: | |
sudo docker run -it hello-world | |
## Configure GeoNode via Docker http://docs.geonode.org/en/master/install/core/index.html#docker | |
sudo mkdir -p /opt/geonode/ | |
sudo usermod -a -G www-data geonode | |
sudo chown -Rf geonode:www-data /opt/geonode/ | |
sudo chmod -Rf 775 /opt/geonode/ | |
# Clone the GeoNode source code on /opt/geonode | |
cd /opt | |
git clone https://github.com/GeoNode/geonode.git geonode | |
## Install GeoNode | |
cd /opt/geonode | |
#edit docker-compose.override.localhost putting the configuration of your server (allowed host add IP) | |
django: | |
build: . | |
# Loading the app is defined here to allow for | |
# autoreload on changes it is mounted on top of the | |
# old copy that docker added when creating the image | |
volumes: | |
- '.:/usr/src/app' | |
environment: | |
- DEBUG=False | |
- GEONODE_LB_HOST_IP=176.223.141.158 | |
- GEONODE_LB_PORT=80 | |
- SITEURL=http://176.223.141.158/ | |
- ALLOWED_HOSTS=['localhost','176.223.141.158' ] | |
- GEOSERVER_PUBLIC_LOCATION=http://176.223.141.158/geoserver/ | |
- GEOSERVER_WEB_UI_LOCATION=http://176.223.141.158/geoserver/ | |
geoserver: | |
environment: | |
- GEONODE_LB_HOST_IP=176.223.141.158 | |
- GEONODE_LB_PORT=80 | |
sudo docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml pull | |
sudo docker-compose -f docker-compose.yml -f docker-compose.override.localhost.yml up -d | |
### TIPS ### | |
#To increase the size of the files to upload: | |
#Enter in the nginx container | |
sudo docker exec -ti nginx4geonode /bin/bash | |
apt update | |
apt install nano | |
cd etc/nginx | |
nano nginx.conf | |
#edit the row: | |
client_max_body_size 2M; ##increase this value in M | |
exit | |
docker restart nginx4geonode | |
# To edit the template modify the files in /opt/geonode/geonode//templates and then run the command (css in /opt/geonode/geonode/static/geonode ) | |
sudo docker exec -ti django4geonode python manage.py collectstatic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment