Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ FROM build as star-server

VOLUME /config
EXPOSE 5000
EXPOSE 4009 # NOTE Debug port do not expose in production.
RUN echo '#!/bin/sh\n\
set -e\n\
# Check if /config/init.lisp exists; if not, use /root/init.lisp\n\
Expand Down
56 changes: 56 additions & 0 deletions docker-compose.override.dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
version: '3.8'
# This is the compose to be used for hacking on gserver
# No state is set just restart to get to a blank state
services:
couchdb:
container_name: "couchdb"
hostname: couchdb
volumes: !reset []
image: ibmcom/couchdb3
environment:
COUCHDB_USER: admin
COUCHDB_PASSWORD: password
ports:
- "5984:5984"
networks:
- star

rabbitmq:
image: rabbitmq:management
hostname: rabbitmq
container_name: "rabbitmq"
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
volumes: !reset []
ports:
- "5672:5672"
- "15672:15672"
networks:
- star

star-server:
hostname: star-server
container_name: "star-server"
restart: always
build: .
volumes:
- ./config:/config
environment:
BUILD_MODE: DEV
ports:
- "4009:4009"
- "5000:5000"
networks:
- star
- default
depends_on:
- couchdb
- rabbitmq
extra_hosts:
- host.docker.internal:host-gateway

networks:
star:
name: star
default:
64 changes: 64 additions & 0 deletions docker-compose.override.prod.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
version: '3.8'
# This is an example production compose file
# instead of using a named volume this bind mounds the state for couchdb and rabbitmq to a dir
# TODO Nginx rev proxy
services:
couchdb:
container_name: "couchdb"
hostname: couchdb
image: ibmcom/couchdb3
volumes:
- ./state/couchdb:/opt/couchdb/data
environment:
#NOTE CHANGE ME
COUCHDB_USER: admin
COUCHDB_PASSWORD: password
ports:
- "5984:5984"
networks:
- star

rabbitmq:
image: rabbitmq:management
hostname: rabbitmq
container_name: "rabbitmq"
environment:
#NOTE CHANGEME
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
ports:
- "5672:5672"
- "15672:15672"
volumes:
- ./state/rabbitmq:/var/lib/rabbitmq
networks:
- star
star-server:
hostname: star-server
container_name: "star-server"
restart: always
build: .
volumes:
# You can copy example_configs to ./config in order to configure star-server
- ./config:/config
ports:
# port 4009 is a debugging port and you MUST disable it during prod use
- "5000:5000"
networks:
- star
- default
depends_on:
- couchdb
- rabbitmq
extra_hosts:
- host.docker.internal:host-gateway



networks:
star:
name: star
default:
volumes:
couchdb:
rabbitmq:
22 changes: 15 additions & 7 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
hostname: couchdb
image: ibmcom/couchdb3
volumes:
- couchdb_data:/opt/couchdb/data
- couchdb:/opt/couchdb/data
environment:
#NOTE CHANGE ME
COUCHDB_USER: admin
Expand All @@ -27,30 +27,38 @@ services:
ports:
- "5672:5672"
- "15672:15672"
volumes:
- rabbitmq:/var/lib/rabbitmq
networks:
- star
star-server:
hostname: star-server
container_name: "star-server"
restart: always
image: star-server:latest
hostname: star-server
build: .
volumes:
- ./init.lisp:/root/init.lisp
# You can copy example_configs to ./config in order to configure star-server
- ./config:/config
environment:
BUILD_MODE: DEV
ports:
# port 4009 is a debugging port and you MUST disable it during prod use
- "5000:5000"
networks:
- star
- default
depends_on:
- couchdb
- rabbitmq
extra_hosts:
- host.docker.internal:host-gateway



volumes:
couchdb_data:

networks:
star:
name: star
default:
volumes:
couchdb:
rabbitmq:
19 changes: 13 additions & 6 deletions example_configs/init.lisp
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
;; Example config
(in-package :star)
(format t "Starting starintel....")
(setq *rabbit-address* "rabbitmq")
(setq *couchdb-host* "couchdb")
(setq *couchdb-default-database* "starintel")
(format t "Starting starintel....~%")
(log:info "RabbitMQ Service: ~a~%" (setf *rabbit-address* "rabbitmq"))
(log:info "Couchdb Service: ~a~%" (setf *couchdb-host* "couchdb"))
(log:info "Listening On ~a : ~a~%" (setf *http-scheme* "http") (setf *http-api-address* "0.0.0.0"))

;; You can invoke sylnk like so
;; (start-debugger)
;; Set log config path to logs
(log:config :daily "logs/gserver.log"
;; here it defaults to the /config/logs/star-server.log
;; Just uncomment this if you want to not use docker the docker volumne
;; TODO Make a docker vol for logs, instead of writing to the config dir SECURITY risk
;; (log:config :daily "./logs/gserver.log"
;; :file2
;; :sane)
(log:config :daily "/config/logs/gserver.log"
:file2
:sane)

;;

Loading