Compare commits

...

3 commits

Author SHA1 Message Date
44dbc9c59b
ignore test .env files 2025-01-05 22:10:44 +01:00
6adb22d24c
add more informations about c3nav 2025-01-05 22:10:29 +01:00
d55aec74fc
add c3nav 2025-01-05 22:10:01 +01:00
5 changed files with 121 additions and 0 deletions

1
.gitignore vendored Normal file
View file

@ -0,0 +1 @@
.env

View file

@ -1,3 +1,12 @@
Il faut créer un réseau =rick_db= avant de lancer les différents fichiers Docker.
Pour chaque service, il faut créer une nouvelle base.
c3nav
-----
Il faut créer un dossier data à l'endroit voulu (j'ai une préférence pour le dossier /opt).
Une fois le dossier, il faut rajouter c3nav.cfg dedans et taper les commandes suivantes:
chgrp -R 500 data
chmod -R g+rwX data

2
c3nav/c3nav.cfg Normal file
View file

@ -0,0 +1,2 @@
[c3nav]
svg_renderer=rsvg

100
c3nav/compose.yml Normal file
View file

@ -0,0 +1,100 @@
version: '3'
name: c3nav
x-restart-policy: &restart-policy
restart: unless-stopped
x-depends_on-default: &depends_on
condition: service_started
x-depends_on-healthy: &depends_on-healthy
condition: service_healthy
x-healthcheck_defaults: &healthcheck_defaults
interval: 10s
timeout: 2s
retries: 5
start_period: 5s
x-c3nav-defaults: &c3nav-defaults
image: ghcr.io/c3nav/c3nav:${C3NAV_TAG}
depends_on:
redis:
<<: *depends_on-healthy
volumes:
- type: bind
source: ${C3NAV_DOCKER_DATA_DIR:-./data}
target: /data
bind:
create_host_path: true
x-c3nav-environment: &c3nav-environment
C3NAV_DEBUG: false
C3NAV_LOGLEVEL: info
C3NAV_CONFIG: /data/c3nav.cfg
C3NAV_DATA_DIR: /data
C3NAV_DJANGO_ALLOWED_HOSTS: localhost,127.0.0.1,c3nav-core,c3nav-tiles,${C3NAV_DJANGO_ALLOWED_HOSTS:-""},${C3NAV_DOMAIN}
C3NAV_DJANGO_REVERSE_PROXY: "true"
UWSGI_WORKERS: ${C3NAV_CORE_WORKERS:-2}
C3NAV_DATABASE_BACKEND: postgresql
C3NAV_DATABASE_NAME: ${C3NAV_DATABASE_NAME:-c3nav}
C3NAV_DATABASE_USER: ${C3NAV_DATABASE_USER:-postgres}
C3NAV_DATABASE_HOST: ${C3NAV_DATABASE_HOST:-postgres}
C3NAV_DATABASE_PASSWORD: ${C3NAV_DATABASE_PASSWORD:-postgres}
C3NAV_REDIS: "redis://redis:6379/0"
C3NAV_CELERY_BROKER: "redis://redis:6379/1"
C3NAV_CELERY_BACKEND: "redis://redis:6379/2"
services:
c3nav-core:
<<: [*restart-policy, *c3nav-defaults]
command: webstatic-async
environment:
<<: *c3nav-environment
C3NAV_AUTOMIGRATE: yes
healthcheck:
<<: *healthcheck_defaults
test: curl -f http://localhost:8000/
ports:
- "8000:8000"
networks:
- c3nav
- rick_db
c3nav-workers:
<<: [*restart-policy, *c3nav-defaults]
command: worker
environment:
<<: *c3nav-environment
C3NAV_AUTOMIGRATE: no
healthcheck:
interval: 30s
timeout: 15s
retries: 2
start_period: 5s
test: entrypoint worker_healthcheck
networks:
- c3nav
redis:
<<: *restart-policy
image: redis:7.2
command: redis-server --save 60 1 --loglevel warning
healthcheck:
<<: *healthcheck_defaults
test: redis-cli ping
volumes:
- "c3nav-redis:/data"
ulimits:
nofile:
soft: 10032
hard: 10032
networks:
- c3nav
volumes:
c3nav-redis:
external: true
networks:
rick_db:
name: rick_db
external: true
c3nav:
driver: bridge

9
c3nav/env.example Normal file
View file

@ -0,0 +1,9 @@
C3NAV_TAG=8a9cdf1ce88c20a400b1720d75fb0aa08be29519
C3NAV_DOMAIN=c3nav.docker.localhost
# to change the default database name
C3NAV_DATABASE_HOST=rick_psql
C3NAV_DATABASE_USER=psql
C3NAV_DATABASE_PASSWORD=choose-a-password
C3NAV_DATABASE_NAME=c3nav
# if you want to change the default path to the data dir, which by default is a folder called data in this directory
C3NAV_DOCKER_DATA_DIR=/opt/c3nav/data