-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker-compose configuration with pg database
- Loading branch information
1 parent
246f6cb
commit 2e34599
Showing
4 changed files
with
72 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,3 +11,4 @@ ciso_assistant/build.json | |
*.sqlite3 | ||
db/django_secret_key | ||
db/attachments/ | ||
db/data/ |
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,11 @@ | ||
#! /usr/bin/env bash | ||
|
||
if [ -d db/data ] ; then | ||
echo "the database seems already created" | ||
echo "you should launch docker-compose up -d" | ||
else | ||
POSTGRES_PASSWORD=`uuidgen` docker-compose up -d | ||
echo "initialize your superuser account..." | ||
docker-compose exec ciso-assistant python manage.py createsuperuser | ||
echo "for successive runs you can now use docker compose up" | ||
fi |
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,42 @@ | ||
version: "3.5" | ||
services: | ||
ciso-assistant: | ||
build: . | ||
image: ciso-assistant:0.9.1 | ||
container_name: "ciso-assistant" | ||
ports: | ||
- "8000:8000" | ||
depends_on: | ||
postgres: | ||
condition: service_healthy | ||
environment: | ||
DJANGO_DEBUG: "True" | ||
CISO_URL: http://127.0.0.1:8000 | ||
POSTGRES_NAME: postgres | ||
POSTGRES_USER: postgres | ||
POSTGRES_PASSWORD: $POSTGRES_PASSWORD | ||
# CISO_SUPERUSER_EMAIL: [email protected] | ||
EMAIL_HOST: your.mail.server | ||
EMAIL_PORT: 1025 | ||
EMAIL_HOST_USER: '' | ||
EMAIL_HOST_PASSWORD: '' | ||
EMAIL_USE_TLS: "False" | ||
EMAIL_USE_SSL: "False" | ||
DEFAULT_FROM_EMAIL: [email protected] | ||
DB_HOST: ciso-postgres | ||
volumes: | ||
- ./db:/code/db | ||
|
||
postgres: | ||
image: postgres | ||
container_name: "ciso-postgres" | ||
restart: always | ||
environment: | ||
POSTGRES_PASSWORD: $POSTGRES_PASSWORD | ||
volumes: | ||
- ./db/data:/var/lib/postgresql/data | ||
healthcheck: | ||
test: ["CMD-SHELL", "pg_isready -U postgres"] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 5 |