Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Communications Backbone System
communications-backbone
Commits
2271e3f1
Commit
2271e3f1
authored
2 years ago
by
James Kirk
Browse files
Options
Download
Email Patches
Plain Diff
refactor: updated how run_compose rebuilds and the container mount fs
parent
4b3816ce
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
30 additions
and
7 deletions
+30
-7
docker/Dockerfile
docker/Dockerfile
+2
-1
docker/docker-compose.yaml
docker/docker-compose.yaml
+6
-2
endpoints/auth_resource.py
endpoints/auth_resource.py
+1
-1
endpoints/clients.py
endpoints/clients.py
+1
-1
endpoints/token.py
endpoints/token.py
+1
-1
run-compose.sh
run-compose.sh
+19
-1
No files found.
docker/Dockerfile
View file @
2271e3f1
FROM
python:alpine3.17
WORKDIR
/app
COPY
requirements.txt requirements.txt
RUN
pip
install
-r
requirements.txt
COPY
. .
ENTRYPOINT
[ "python" ]
\ No newline at end of file
This diff is collapsed.
Click to expand it.
docker/docker-compose.yaml
View file @
2271e3f1
...
...
@@ -19,7 +19,10 @@ services:
-
rabbitmq__local
environment
:
-
MQ_HOST=rmq
volumes
:
-
../:/app
command
:
"
soar_bus.py"
container_name
:
soar_bus
soar_api
:
build
:
...
...
@@ -35,5 +38,6 @@ services:
environment
:
-
MQ_HOST=rmq
volumes
:
-
${DATA_DIR}/data:${DATA_DIR}/data
command
:
"
api.py"
\ No newline at end of file
-
../:/app
command
:
"
api.py"
container_name
:
soar_api
\ No newline at end of file
This diff is collapsed.
Click to expand it.
endpoints/auth_resource.py
View file @
2271e3f1
...
...
@@ -10,7 +10,7 @@ class AuthResource(Resource):
def
__init__
(
self
):
self
.
token
=
TokenModel
()
with
open
(
"/data/clients.json"
,
"r"
)
as
clients_file
:
with
open
(
"
.
/data/clients.json"
,
"r"
)
as
clients_file
:
self
.
clients
=
json
.
load
(
clients_file
)
def
auth
(
self
,
request
):
...
...
This diff is collapsed.
Click to expand it.
endpoints/clients.py
View file @
2271e3f1
...
...
@@ -13,7 +13,7 @@ class ClientSchema(Schema):
class
ClientsFile
:
file
=
"/data/clients.json"
file
=
"
.
/data/clients.json"
mtime
=
0
clients
=
{}
parser
=
None
...
...
This diff is collapsed.
Click to expand it.
endpoints/token.py
View file @
2271e3f1
...
...
@@ -19,7 +19,7 @@ class Token(Resource):
self
.
schema
=
TokenQuerySchema
()
self
.
model
=
TokenModel
()
data_dir
=
os
.
getenv
(
"DATA_DIR"
,
"/data"
)
with
open
(
data
_dir
+
"
/clients.json"
,
"r"
)
as
clients_file
:
with
open
(
"./
data/clients.json"
,
"r"
)
as
clients_file
:
self
.
clients
=
json
.
load
(
clients_file
)
def
get
(
self
):
...
...
This diff is collapsed.
Click to expand it.
run-compose.sh
View file @
2271e3f1
...
...
@@ -3,8 +3,26 @@
set
-a
source
.env
usage
()
{
echo
"usage: ./run-compose.sh [<rebuild>]"
echo
" rebuild - will force docker-compose to rebuild the images before spinning them up."
}
if
[[
-z
"
${
DATA_DIR
}
"
]]
;
then
DATA_DIR
=
$(
pwd
)
fi
docker-compose
-f
docker/docker-compose.yaml up
--build
\ No newline at end of file
while
[
-n
"
$1
"
]
;
do
case
$1
in
rebuild
)
EXTRA_ARGS
=
"--build"
;;
*
)
usage
exit
0
;;
esac
shift
done
docker-compose
-f
docker/docker-compose.yaml up
$EXTRA_ARGS
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment