Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
62 changes: 21 additions & 41 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,32 @@
FROM geonode/geonode-base:latest-ubuntu-24.04
LABEL GeoNode development team
FROM geonode/geonode-base:latest-ubuntu-26.04

RUN mkdir -p /usr/src/geonode_demo

RUN apt-get update -y && apt-get install curl wget unzip gnupg2 locales -y

RUN sed -i -e 's/# C.UTF-8 UTF-8/C.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
ENV LC_ALL C.UTF-8
ENV LANG C.UTF-8

# add bower and grunt command
COPY src /usr/src/geonode_demo/
ENV LC_ALL=C.UTF-8 \
LANG=C.UTF-8
WORKDIR /usr/src/geonode_demo

#COPY src/monitoring-cron /etc/cron.d/monitoring-cron
#RUN chmod 0644 /etc/cron.d/monitoring-cron
#RUN crontab /etc/cron.d/monitoring-cron
#RUN touch /var/log/cron.log
#RUN service cron start
RUN apt-get update -y && apt-get install -y --no-install-recommends \
curl \
wget \
unzip \
gnupg2 \
locales \
netcat-openbsd \
&& sed -i -e 's/# C.UTF-8 UTF-8/C.UTF-8 UTF-8/' /etc/locale.gen \
&& locale-gen \
&& apt-get autoremove --purge -y \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN python -m pip install --no-cache-dir -U pip setuptools wheel

COPY src/wait-for-databases.sh /usr/bin/wait-for-databases
RUN chmod +x /usr/bin/wait-for-databases
RUN chmod +x /usr/src/geonode_demo/tasks.py \
&& chmod +x /usr/src/geonode_demo/entrypoint.sh

COPY src/celery.sh /usr/bin/celery-commands
RUN chmod +x /usr/bin/celery-commands

COPY src/celery-cmd /usr/bin/celery-cmd
RUN chmod +x /usr/bin/celery-cmd

# Install "geonode-contribs" apps
# RUN cd /usr/src; git clone https://github.com/GeoNode/geonode-contribs.git -b master
# Install logstash and centralized dashboard dependencies
# RUN cd /usr/src/geonode-contribs/geonode-logstash; pip install --upgrade -e . \
# cd /usr/src/geonode-contribs/ldap; pip install --upgrade -e .
RUN chmod +x /usr/bin/wait-for-databases /usr/bin/celery-commands /usr/bin/celery-cmd

RUN yes w | pip install --src /usr/src -r requirements.txt &&\
yes w | pip install -e .
COPY src/ /usr/src/geonode_demo/
RUN chmod +x /usr/src/geonode_demo/tasks.py /usr/src/geonode_demo/entrypoint.sh

# Cleanup apt update lists
RUN apt-get autoremove --purge &&\
apt-get clean &&\
rm -rf /var/lib/apt/lists/*
RUN pip install --no-cache-dir -e .

# Export ports
EXPOSE 8000

# We provide no command or entrypoint as this image can be used to serve the django project or run celery tasks
# ENTRYPOINT /usr/src/geonode_demo/entrypoint.sh
78 changes: 37 additions & 41 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# Common Django template for GeoNode and Celery services below
x-common-django:
&default-common-django
image: ${COMPOSE_PROJECT_NAME}/geonode:${GEONODE_BASE_IMAGE_VERSION}
Expand All @@ -15,6 +14,8 @@ x-common-django:
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy

services:

Expand All @@ -26,7 +27,7 @@ services:
dockerfile: Dockerfile
container_name: django4${COMPOSE_PROJECT_NAME}
healthcheck:
test: "curl -m 10 --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://django:8000/"
test: "curl -m 10 --fail --silent --output /dev/null http://django:8000/"
start_period: 60s
interval: 60s
timeout: 10s
Expand All @@ -47,9 +48,15 @@ services:
- IS_CELERY=True
entrypoint: ["/usr/src/geonode_demo/entrypoint.sh"]
command: "celery-cmd"
healthcheck:
test: "celery -b ${BROKER_URL} inspect ping"
start_period: 30s
interval: 30s
timeout: 10s
retries: 2

# Nginx is serving django static and media files and proxies to django and geonode
geonode:
nginx:
image: ${COMPOSE_PROJECT_NAME}/nginx:${NGINX_BASE_IMAGE_VERSION}
build:
context: ./docker/nginx
Expand All @@ -58,7 +65,7 @@ services:
- BASE_IMAGE_VERSION=${NGINX_BASE_IMAGE_VERSION}
container_name: nginx4${COMPOSE_PROJECT_NAME}
env_file:
- .env
- .env${ENVIRONMENT:+_}${ENVIRONMENT:-}
environment:
- RESOLVER=127.0.0.11
ports:
Expand All @@ -69,19 +76,12 @@ services:
- nginx-certificates:/geonode-certificates
- statics:/mnt/volumes/statics
restart: unless-stopped

# memcached service
memcached:
image: memcached:alpine
container_name: memcached4${COMPOSE_PROJECT_NAME}
command: memcached ${MEMCACHED_OPTIONS}
restart: on-failure
healthcheck:
test: nc -z 127.0.0.1 11211
interval: 30s
timeout: 30s
retries: 5
start_period: 30s
test: "if ps -o pid | grep -w 1 > /dev/null; then echo 'nginx running'; else exit 1;fi"
interval: 10s
timeout: 5s
retries: 3
start_period: 10s

# Gets and installs letsencrypt certificates
letsencrypt:
Expand All @@ -97,6 +97,9 @@ services:
volumes:
- nginx-certificates:/geonode-certificates
restart: unless-stopped
depends_on:
nginx:
condition: service_healthy

# Geoserver backend
geoserver:
Expand All @@ -108,11 +111,11 @@ services:
- BASE_IMAGE_VERSION=${GEOSERVER_BASE_IMAGE_VERSION}
container_name: geoserver4${COMPOSE_PROJECT_NAME}
healthcheck:
test: "curl -m 10 --fail --silent --write-out 'HTTP CODE : %{http_code}\n' --output /dev/null http://geoserver:8080/geoserver/ows"
start_period: 60s
interval: 60s
test: ["CMD", "curl", "-f", "http://geoserver:8080/geoserver/web/wicket/resource/org.geoserver.web.GeoServerBasePage/img/logo.png"]
start_period: 30s
interval: 30s
timeout: 10s
retries: 2
retries: 3
env_file:
- .env
ports:
Expand All @@ -125,25 +128,9 @@ services:
- tmp:/tmp
restart: unless-stopped
depends_on:
data-dir-conf:
condition: service_healthy
django:
condition: service_healthy

data-dir-conf:
image: ${COMPOSE_PROJECT_NAME}/geoserver_data:${GEOSERVER_DATA_BASE_IMAGE_VERSION}
build:
context: ./docker/geoserver_data
dockerfile: Dockerfile
args:
- BASE_IMAGE_VERSION=${GEOSERVER_DATA_BASE_IMAGE_VERSION}
container_name: gsconf4${COMPOSE_PROJECT_NAME}
entrypoint: sleep infinity
volumes:
- geoserver-data-dir:/geoserver_data/data
restart: unless-stopped
healthcheck:
test: "ls -A '/geoserver_data/data' | wc -l"

# PostGIS database.
db:
Expand All @@ -162,18 +149,27 @@ services:
- dbbackups:/pg_backups
restart: unless-stopped
healthcheck:
test: "pg_isready -d postgres -U postgres"
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"
test: ["CMD-SHELL", "pg_isready -d postgres -U postgres"]
interval: 10s
timeout: 5s
retries: 5
# uncomment to enable remote connections to postgres
#ports:
# - "5432:5432"

# Vanilla RabbitMQ service. This is needed by celery
# Vanilla Redis service. This is needed by celery
redis:
image: redis:7-alpine
container_name: redis4${COMPOSE_PROJECT_NAME}
volumes:
- redisdata:/data
restart: unless-stopped
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 20s
timeout: 3s
retries: 3
start_period: 5s

volumes:
statics:
Expand Down
30 changes: 30 additions & 0 deletions src/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"

[project]
name = "geonode_project"
version = "5.dev"
description = "GeoNode Project"
readme = "README.md"
requires-python = ">=3.10"
license = { text = "GPL-3.0-or-later" }
keywords = ["project", "geonode", "django"]

dependencies = [
"GeoNode @ https://github.com/GeoNode/geonode/archive/refs/heads/master.zip"
]

[project.urls]
Homepage = "https://github.com/GeoNode/geonode-project"

[tool.setuptools]
include-package-data = true

# Correct package discovery layout
[tool.setuptools.packages.find]
where = ["."]
exclude = ["tests*"]

[tool.setuptools.package-data]
"*" = ["**/thesauri/*.rdf"]
2 changes: 0 additions & 2 deletions src/requirements.txt

This file was deleted.

Loading