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
2 changes: 1 addition & 1 deletion .github/workflows/check-code-and-docs-validation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Set up Python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
with:
python-version: "3.14"
python-version: "3.15"

- name: Install uv from vendored wheel
run: pip install --no-index --find-links=./thirdparty/dist uv
Expand Down
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# See https://aboutcode.org for more information about AboutCode FOSS projects.
#

FROM python:3.14-slim
FROM python:3.15-slim-trixie

LABEL org.opencontainers.image.source="https://github.com/aboutcode-org/dejacode"
LABEL org.opencontainers.image.description="DejaCode"
Expand Down Expand Up @@ -36,6 +36,7 @@ RUN apt-get update \
build-essential \
libldap2-dev \
libsasl2-dev \
libyaml-dev \
slapd \
ldap-utils \
libpq5 \
Expand Down
13 changes: 10 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ shell:
# make test - full suite
# make test k=<pattern> - filter by name, e.g. make test k=test_name
test:
${MANAGE} test --noinput --parallel auto $(if $(k),-k $(k),)
${COMPOSE} run --rm web ./manage.py test --noinput --parallel auto $(if $(k),-k $(k),)

migrations:
@echo "-> Creates new database migrations"
Expand Down Expand Up @@ -117,13 +117,20 @@ upgrade:
--platform manylinux_2_28_x86_64 \
--platform manylinux_2_17_x86_64 \
--platform manylinux_2_12_x86_64 \
--python-version 3.14 \
--python-version 3.15 \
--dest ./thirdparty/dist/
@echo "-> Download $(PACKAGE) wheels for Linux ARM64"
uvx pip download $(PACKAGE) \
--only-binary=:all: \
--platform manylinux_2_28_aarch64 \
--platform manylinux_2_17_aarch64 \
--python-version 3.15 \
--dest ./thirdparty/dist/
@echo "-> Download $(PACKAGE) wheels for macOS ARM64"
uvx pip download $(PACKAGE) \
--only-binary=:all: \
--platform macosx_11_0_arm64 \
--python-version 3.14 \
--python-version 3.15 \
--dest ./thirdparty/dist/
@echo "-> Update pyproject.toml and uv.lock"
uvx uv add $(PACKAGE)
Expand Down
1 change: 1 addition & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
- Update the version in:
- `pyproject.toml`
- `dejacode/__init__.py`
- `compose.yml` and `compose.demo.yml` (the `ghcr.io/aboutcode-org/dejacode:vx.x.x` image tag)
- `CHANGELOG.rst` (set date)
- Refresh `uv.lock` with `uvx uv lock` and check it with `uvx uv lock --check`
- Commit and push this branch
Expand Down
8 changes: 6 additions & 2 deletions compose.build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@ x-description: "Build override: builds the app image from source instead of usin
services:
web:
build: .
image: dejacode:local
pull_policy: build

worker:
build: .
image: dejacode:local
pull_policy: never

scheduler:
build: .
image: dejacode:local
pull_policy: never
4 changes: 2 additions & 2 deletions compose.demo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ x-description: "Minimal demo stack: web + db only, auto-created superuser, Codes

services:
db:
image: docker.io/library/postgres:16.15
image: docker.io/library/postgres:16.16
env_file:
- .env.demo
volumes:
Expand All @@ -20,7 +20,7 @@ services:
start_interval: 1s

web:
image: ghcr.io/aboutcode-org/dejacode:latest
image: ghcr.io/aboutcode-org/dejacode:v6.0.1
command: sh -c "
./manage.py migrate &&
(./manage.py createsuperuser --noinput || true) &&
Expand Down
2 changes: 1 addition & 1 deletion compose.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ x-description: "Development stack: source mounted, runserver with auto-reload"

services:
db:
image: docker.io/library/postgres:16.15
image: docker.io/library/postgres:16.16
env_file:
- docker.env
volumes:
Expand Down
49 changes: 32 additions & 17 deletions compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ x-description: "Full DejaCode stack: all services, pre-built image, no checkout

services:
db:
image: docker.io/library/postgres:16.15
image: docker.io/library/postgres:16.16
env_file:
- docker.env
volumes:
Expand All @@ -19,21 +19,26 @@ services:
retries: 5

redis:
image: docker.io/library/redis:8.8-alpine
image: docker.io/library/redis:8.10.3-alpine
# Enable redis data persistence using the "Append Only File" with the
# default policy of fsync every second. See https://redis.io/topics/persistence
command: redis-server --appendonly yes
command: redis-server --appendonly yes --loglevel warning
volumes:
- redis_data:/data
restart: always
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5

web:
image: ghcr.io/aboutcode-org/dejacode:latest
image: ghcr.io/aboutcode-org/dejacode:v6.0.1
command: sh -c "
./manage.py migrate &&
./manage.py collectstatic --no-input --verbosity 0 --clear &&
gunicorn dejacode.wsgi:application --bind :8000 --timeout 600 \
--workers 4 --worker-tmp-dir /dev/shm"
--workers ${GUNICORN_WORKERS:-4} --worker-tmp-dir /dev/shm"
env_file:
- docker.env
expose:
Expand All @@ -42,16 +47,17 @@ services:
- .env:/opt/dejacode/.env
- static:/var/dejacode/static
- media:/var/dejacode/media
restart: always
depends_on:
db:
condition: service_healthy
redis:
condition: service_started
condition: service_healthy
clamav:
condition: service_started

worker:
image: ghcr.io/aboutcode-org/dejacode:latest
image: ghcr.io/aboutcode-org/dejacode:v6.0.1
# Ensure that potential db migrations run first by waiting until "web" is up
command: wait-for-it --strict --timeout=180 web:8000 -- sh -c "
./manage.py rqworker-pool --num-workers 2 --verbosity 1"
Expand All @@ -61,25 +67,33 @@ services:
- .env:/opt/dejacode/.env
# The media volume is required to access uploaded files from the worker
- media:/var/dejacode/media
restart: always
depends_on:
- redis
- db
- web
db:
condition: service_healthy
redis:
condition: service_healthy
web:
condition: service_started

scheduler:
image: ghcr.io/aboutcode-org/dejacode:latest
image: ghcr.io/aboutcode-org/dejacode:v6.0.1
command: wait-for-it web:8000 -- sh -c "./manage.py rqcron dje.cron_jobs"
env_file:
- docker.env
volumes:
- .env:/opt/dejacode/.env
restart: always
depends_on:
- redis
- db
- web
db:
condition: service_healthy
redis:
condition: service_healthy
web:
condition: service_started

nginx:
image: docker.io/library/nginx:1.30-alpine
image: docker.io/library/nginx:1.31.9-alpine-slim
ports:
- "${NGINX_PUBLISHED_HTTP_PORT:-80}:80"
- "${NGINX_PUBLISHED_HTTPS_PORT:-443}:443"
Expand All @@ -88,11 +102,12 @@ services:
- static:/var/dejacode/static/
- webroot:/var/www/html/
depends_on:
- web
web:
condition: service_started
restart: always

clamav:
image: docker.io/clamav/clamav:1.5_base
image: docker.io/clamav/clamav:1.5.4_base-debian13-slim
volumes:
- clamav_data:/var/lib/clamav
- media:/var/dejacode/media
Expand Down
3 changes: 3 additions & 0 deletions docs/application-settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,9 @@ default the ``UTC`` time zone is used. For example::

TIME_ZONE=US/Pacific

Scheduled tasks, such as the daily vulnerabilities update, run according to
this time zone.

.. note::
You can view a detailed list of time zones `here.
<https://en.wikipedia.org/wiki/List_of_tz_database_time_zones>`_
Expand Down
18 changes: 14 additions & 4 deletions docs/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,8 @@ Access the application
<a href="http://localhost/" target="_blank" class="external">http://localhost/</a>

.. note::
The pre-built image always corresponds to the most recent release and is tagged
``latest``.
``compose.yml`` pins the pre-built image to the DejaCode release it was
downloaded with.

.. _dejacode_command:

Expand All @@ -100,11 +100,13 @@ The ``dejacode`` command is a thin wrapper around ``docker compose``. All standa
dejacode ps # show service status
dejacode logs -f # follow all logs
dejacode logs -f web # follow logs for a specific service
dejacode pull # pull the latest image
dejacode pull # pull the images defined in compose.yml
dejacode exec web ./manage.py createsuperuser

To update DejaCode to the latest release::
To update DejaCode to the latest release, download the latest ``compose.yml``,
then pull and restart::

curl -sSL https://raw.githubusercontent.com/aboutcode-org/dejacode/main/compose.yml -o ~/.dejacode/compose.yml
dejacode pull && dejacode up -d

To completely remove DejaCode and all its data::
Expand Down Expand Up @@ -152,6 +154,14 @@ and restart::

dejacode down && dejacode up -d

Web server workers
^^^^^^^^^^^^^^^^^^

The web service runs 4 Gunicorn workers by default. To change it, set
``GUNICORN_WORKERS`` in ``~/.dejacode/.env`` and apply::

dejacode up -d

AboutCode integrations
^^^^^^^^^^^^^^^^^^^^^^

Expand Down
4 changes: 3 additions & 1 deletion etc/nginx/conf.d/default.conf
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
# Do not disclose the nginx version in the error pages and headers.
server_tokens off;

upstream gunicorn_app {
server web:8000;
}

server {
listen 80;
http2 on;
server_tokens off;

gzip on;
gzip_comp_level 6;
Expand Down
4 changes: 3 additions & 1 deletion etc/nginx/examples/ssl.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
# Do not disclose the nginx version in the error pages and headers.
server_tokens off;

upstream gunicorn_app {
server web:8000;
}
Expand All @@ -10,7 +13,6 @@ server {
server {
listen 443 ssl;
http2 on;
server_tokens off;

ssl_certificate /etc/nginx/conf.d/fullchain.pem;
ssl_certificate_key /etc/nginx/conf.d/privkey.pem;
Expand Down
Loading
Loading