-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d60b1e
commit 3b6915e
Showing
9 changed files
with
147 additions
and
16 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,133 @@ | ||
services: | ||
cache: | ||
image: redis:7-alpine | ||
networks: | ||
- cache | ||
restart: unless-stopped | ||
volumes: | ||
- redis:/data | ||
db: | ||
image: postgres:12-alpine | ||
environment: | ||
POSTGRES_DB: | ||
POSTGRES_DB_FILE: | ||
POSTGRES_PASSWORD: | ||
POSTGRES_PASSWORD_FILE: | ||
POSTGRES_USER: | ||
POSTGRES_USER_FILE: | ||
networks: | ||
- database | ||
restart: unless-stopped | ||
volumes: | ||
- pgdata:/var/lib/postgresql/data | ||
|
||
backend: | ||
image: mathiasertl/django-ca:${DJANGO_CA_VERSION:-1.24.0} | ||
command: ./celery.sh -l ${CELERY_LOG_LEVEL:-warning} | ||
depends_on: | ||
- cache | ||
- db | ||
networks: | ||
- cache | ||
- database | ||
- public | ||
volumes: | ||
- backend_ca_dir:/var/lib/django-ca/certs/ | ||
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/ | ||
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/ | ||
environment: | ||
DJANGO_CA_ALLOWED_HOSTS: | ||
DJANGO_CA_CA_DEFAULT_CA: | ||
DJANGO_CA_CA_DEFAULT_HOSTNAME: | ||
DJANGO_CA_CA_ENABLE_ACME: | ||
DJANGO_CA_SECRET_KEY: | ||
DJANGO_CA_SECRET_KEY_FILE: ${DJANGO_CA_SECRET_KEY_FILE:-/var/lib/django-ca/certs/ca/shared/secret_key} | ||
DJANGO_CA_SETTINGS: ${DJANGO_CA_SETTINGS:-conf/:conf/compose} | ||
POSTGRES_DB: | ||
POSTGRES_DB_FILE: | ||
POSTGRES_PASSWORD: | ||
POSTGRES_PASSWORD_FILE: | ||
POSTGRES_USER: | ||
POSTGRES_USER_FILE: | ||
WAIT_FOR_CONNECTIONS: 'db:5432' | ||
restart: unless-stopped | ||
stop_grace_period: 30s | ||
|
||
frontend: | ||
image: mathiasertl/django-ca:${DJANGO_CA_VERSION:-1.24.0} | ||
depends_on: | ||
- cache | ||
- db | ||
networks: | ||
- cache | ||
- database | ||
- frontend | ||
volumes: | ||
- static:/usr/share/django-ca/static/ | ||
- frontend_ca_dir:/var/lib/django-ca/certs/ | ||
- shared_ca_dir:/var/lib/django-ca/certs/ca/shared/ | ||
- ocsp_key_dir:/var/lib/django-ca/certs/ocsp/ | ||
- nginx_config:/usr/src/django-ca/nginx/ | ||
environment: | ||
DJANGO_CA_ALLOWED_HOSTS: | ||
DJANGO_CA_CA_DEFAULT_CA: | ||
DJANGO_CA_CA_DEFAULT_HOSTNAME: | ||
DJANGO_CA_CA_ENABLE_ACME: | ||
DJANGO_CA_SECRET_KEY: | ||
DJANGO_CA_SECRET_KEY_FILE: ${DJANGO_CA_SECRET_KEY_FILE:-/var/lib/django-ca/certs/ca/shared/secret_key} | ||
DJANGO_CA_SETTINGS: ${DJANGO_CA_SETTINGS:-conf/:conf/compose} | ||
POSTGRES_DB: | ||
POSTGRES_DB_FILE: | ||
POSTGRES_PASSWORD: | ||
POSTGRES_PASSWORD_FILE: | ||
POSTGRES_USER: | ||
POSTGRES_USER_FILE: | ||
WAIT_FOR_CONNECTIONS: 'db:5432' | ||
restart: unless-stopped | ||
healthcheck: | ||
test: ["CMD", "/usr/src/django-ca/ca/uwsgi-health.py"] | ||
timeout: 3s | ||
start_period: 25s | ||
interval: 10s | ||
stop_signal: SIGINT | ||
|
||
webserver: | ||
image: nginx:1.22-alpine | ||
command: /bin/sh -c "envsubst < /etc/nginx/conf.d/${NGINX_TEMPLATE:-default}.template > /etc/nginx/conf.d/default.conf && exec nginx -g 'daemon off;'" | ||
depends_on: | ||
frontend: | ||
condition: service_healthy | ||
environment: | ||
NGINX_HOST: ${DJANGO_CA_CA_DEFAULT_HOSTNAME:-localhost} | ||
NGINX_PORT: ${NGINX_PORT:-80} | ||
NGINX_HTTPS_PORT: ${NGINX_HTTPS_PORT:-443} | ||
NGINX_PRIVATE_KEY: | ||
NGINX_PUBLIC_KEY: | ||
ports: | ||
- 80:80 | ||
networks: | ||
- frontend | ||
- public | ||
volumes: | ||
- nginx_config:/etc/nginx/conf.d/ | ||
- static:/usr/share/nginx/html/static/ | ||
|
||
volumes: | ||
shared: | ||
static: | ||
backend_ca_dir: | ||
frontend_ca_dir: | ||
shared_ca_dir: | ||
ocsp_key_dir: | ||
nginx_config: | ||
pgdata: | ||
redis: | ||
|
||
networks: | ||
public: | ||
frontend: | ||
internal: true | ||
cache: | ||
internal: true | ||
database: | ||
internal: true |
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
2 changes: 1 addition & 1 deletion
2
docs/source/include/quickstart_with_docker_compose/setup-cas.yaml
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
commands: | ||
- command: docker compose exec backend manage createsuperuser | ||
run: docker compose exec backend manage shell -c "from django.contrib.auth import get_user_model; User = get_user_model(); User.objects.create_superuser('user', '[email protected]', 'nopass')" | ||
- command: docker compose exec backend manage init_ca --path_length=1 Root /CN=Root | ||
- command: docker compose exec backend manage init_ca --path-length=1 Root /CN=Root | ||
- command: docker compose exec backend manage init_ca --path=ca/shared/ --parent=Root Intermediate /CN=Intermediate |
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