-
Notifications
You must be signed in to change notification settings - Fork 315
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #508 from intuitem/compose_pg_variant
Add Docker compose variant with PG
- Loading branch information
Showing
2 changed files
with
76 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#! /usr/bin/env bash | ||
|
||
echo "This is a sample for running the CISO Assistant Community Edition with a PostgreSQL database" | ||
echo "You should adjust the docker-compose-pg.yml file with right credentials and settings and most likely split the db on a separate server in a production environment" | ||
|
||
if [ -d ./db ] ; then | ||
echo "the database seems already created" | ||
echo "you should launch docker compose -f docker-compose-pg.yml up -d" | ||
echo "for clean start, you can remove the database folder and files, run docker compose down and then docker compose rm and start again" | ||
else | ||
docker rmi ghcr.io/intuitem/ciso-assistant-community/backend:latest ghcr.io/intuitem/ciso-assistant-community/frontend:latest 2> /dev/null | ||
docker compose -f docker-compose-pg.yml up -d | ||
docker compose -f docker-compose-pg.yml exec backend python manage.py migrate | ||
echo "initialize your superuser account..." | ||
docker compose -f docker-compose-pg.yml exec backend python manage.py createsuperuser | ||
echo "connect to ciso assistant on https://localhost:8443 or the custom url if you have set it" | ||
echo "for successive runs you can now use docker compose -f docker-compose-pg.yml 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,58 @@ | ||
version: "3.9" | ||
|
||
services: | ||
backend: | ||
container_name: backend | ||
image: ghcr.io/intuitem/ciso-assistant-community/backend:latest | ||
restart: always | ||
depends_on: | ||
- postgres | ||
environment: | ||
- ALLOWED_HOSTS=backend | ||
- CISO_ASSISTANT_URL=https://localhost:8443 | ||
- DJANGO_DEBUG=True | ||
- POSTGRES_NAME=ciso_assistant | ||
- POSTGRES_USER=ciso_assistant | ||
- POSTGRES_PASSWORD=ciso_assistant | ||
- DB_HOST=postgres | ||
volumes: | ||
- ./db:/code/db | ||
|
||
frontend: | ||
container_name: frontend | ||
environment: | ||
- PUBLIC_BACKEND_API_URL=http://backend:8000/api | ||
- PROTOCOL_HEADER=x-forwarded-proto | ||
- HOST_HEADER=x-forwarded-host | ||
|
||
image: ghcr.io/intuitem/ciso-assistant-community/frontend:latest | ||
depends_on: | ||
- backend | ||
|
||
postgres: | ||
container_name: postgres | ||
image: postgres:16 | ||
restart: always | ||
environment: | ||
POSTGRES_DB: ciso_assistant | ||
POSTGRES_USER: ciso_assistant | ||
POSTGRES_PASSWORD: ciso_assistant | ||
volumes: | ||
- ./db/pg:/var/lib/postgresql/data | ||
|
||
|
||
caddy: | ||
container_name: caddy | ||
image: caddy:2.7.6 | ||
restart: unless-stopped | ||
ports: | ||
- 8443:8443 | ||
command: | ||
- caddy | ||
- reverse-proxy | ||
- --from | ||
- https://localhost:8443 | ||
- --to | ||
- frontend:3000 | ||
volumes: | ||
- ./db:/data |