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
64 changes: 24 additions & 40 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,40 +1,24 @@
**/.*
**/.git
**/.gitignore
**/.github
**/.vscode
**/.idea
**/coverage
**/.aws
**/.ssh
**/.DS_Store
**/.aof
**/venv
**/.venv
**/env
**/bin
# **/docs we want to keep dje/templates/rest_framework/docs/
docs/
# **/dist we want to keep ./thirdparty/dist/
# **/etc we need to keep ./etc/
**/lib
**/include
**/share
**/var
**/*.egg-info
**/*.log
**/__pycache__
**/.*cache
*.pyc
.dockerignore
.readthedocs.yaml
docker.env
.env
Makefile
Dockerfile
README.rst
CHANGELOG.rst
CONTRIBUTING.rst
MANIFEST.in
docker-compose.yml
pyvenv.cfg
# Ignore everything
*

# Allow only what the build needs
!aboutcode/
!component_catalog/
!data/
!dejacode/
!dejacode_toolkit/
!dje/
!license_library/
!notification/
!organization/
!policy/
!product_portfolio/
!purldb/
!reporting/
!thirdparty/
!vulnerabilities/
!workflow/
!LICENSE
!manage.py
!NOTICE
!pyproject.toml
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@ ENV VENV_LOCATION=/opt/$APP_NAME/.venv
ENV PYTHONUNBUFFERED=1
# Do not write Python .pyc files
ENV PYTHONDONTWRITEBYTECODE=1
# Add the app dir in the Python path for entry points availability
ENV PYTHONPATH=$PYTHONPATH:$APP_DIR
# Set the app dir in the Python path for entry points availability
ENV PYTHONPATH=$APP_DIR

# OS requirements
RUN apt-get update \
Expand Down
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ DB_CONTAINER_NAME=db
DB_INIT_FILE=./data/postgresql/initdb.sql.gz
POSTGRES_INITDB_ARGS=--encoding=UTF-8 --lc-collate=en_US.UTF-8 --lc-ctype=en_US.UTF-8
TIMESTAMP=$(shell date +"%Y-%m-%d_%H%M")
IMAGE_NAME=dejacode

# Use sudo for postgres, only on Linux
UNAME := $(shell uname)
Expand Down Expand Up @@ -156,11 +157,11 @@ docs:
@${ACTIVATE} sphinx-build -b html ${DOCS_LOCATION} ${DOCS_LOCATION}/_build/html/

build:
@echo "-> Build the Docker images"
${DOCKER_COMPOSE} build
@echo "-> Build the Docker image"
docker build -t $(IMAGE_NAME) .

bash:
${DOCKER_EXEC} web bash
docker run -it $(IMAGE_NAME) bash

shell:
${DOCKER_EXEC} web ./manage.py shell
Expand Down
11 changes: 5 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
name: dejacode
services:
db:
image: postgres:16
image: docker.io/library/postgres:16.13
env_file:
- docker.env
volumes:
Expand All @@ -15,7 +16,7 @@ services:
retries: 5

redis:
image: redis:alpine
image: docker.io/library/redis:8.6-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
Expand Down Expand Up @@ -78,7 +79,7 @@ services:
- web

nginx:
image: nginx:alpine
image: docker.io/library/nginx:1.29-alpine
ports:
- "${NGINX_PUBLISHED_HTTP_PORT:-80}:80"
- "${NGINX_PUBLISHED_HTTPS_PORT:-443}:443"
Expand All @@ -91,12 +92,10 @@ services:
restart: always

clamav:
image: clamav/clamav
image: docker.io/clamav/clamav:1.5_base
volumes:
- clamav_data:/var/lib/clamav
- media:/var/dejacode/media
ports:
- "3310:3310"
restart: always

volumes:
Expand Down
Loading