Skip to content

Commit

Permalink
switch compose to prebuilt images
Browse files Browse the repository at this point in the history
  • Loading branch information
ab-smith committed Apr 13, 2024
1 parent 5a28087 commit 6a3b00a
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 3 deletions.
14 changes: 14 additions & 0 deletions docker-compose-build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#! /usr/bin/env bash

if [ -f db/ciso-assistant.sqlite3 ] ; then
echo "the database seems already created"
echo "you should launch docker compose up -d"
else
docker compose -f docker-compose-build.yml build
docker compose -f docker-compose-build.yml up -d
docker compose exec backend python manage.py migrate
echo "initialize your superuser account..."
docker compose exec backend python manage.py createsuperuser
echo "connect to ciso assistant on https://localhost:8443"
echo "for successive runs you can now use docker compose up"
fi
40 changes: 40 additions & 0 deletions docker-compose-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
version: "3.9"

services:
backend:
container_name: backend
build: ./backend
restart: always
environment:
- ALLOWED_HOSTS=backend
- CISO_ASSISTANT_URL=https://localhost:8443
- DJANGO_DEBUG=True
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

build: ./frontend
depends_on:
- backend

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
1 change: 0 additions & 1 deletion docker-compose.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ if [ -f db/ciso-assistant.sqlite3 ] ; then
echo "the database seems already created"
echo "you should launch docker compose up -d"
else
docker compose build
docker compose up -d
docker compose exec backend python manage.py migrate
echo "initialize your superuser account..."
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: "3.9"
services:
backend:
container_name: backend
build: ./backend
image: ghcr.io/intuitem/ciso-assistant-community/backend:latest
restart: always
environment:
- ALLOWED_HOSTS=backend
Expand All @@ -19,7 +19,7 @@ services:
- PROTOCOL_HEADER=x-forwarded-proto
- HOST_HEADER=x-forwarded-host

build: ./frontend
image: ghcr.io/intuitem/ciso-assistant-community/frontend:latest
depends_on:
- backend

Expand Down

0 comments on commit 6a3b00a

Please sign in to comment.