File tree 4 files changed +27
-5
lines changed
4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -13,5 +13,8 @@ COPY . /app
13
13
RUN cd backend && ./setup-sigma-versions.sh
14
14
15
15
# launch front- and backend
16
+ # Expose frontend port
16
17
EXPOSE 8000
18
+ # Expose backend ports (for Sigma versions)
19
+ EXPOSE 8100-8199
17
20
ENTRYPOINT ["./entrypoint.sh" ]
Original file line number Diff line number Diff line change @@ -22,8 +22,15 @@ poetry run ./run.py
22
22
### With Docker:
23
23
24
24
``` bash
25
+ # Build the image
25
26
docker build -t sigconverter.io .
26
- docker run -d -p 8000:8000 sigconverter.io
27
+
28
+ # Run the container
29
+ # Note: We need to expose both the frontend port (8000) and backend ports (8100-8199)
30
+ docker run -d \
31
+ -p 8000:8000 \
32
+ -p 8100-8199:8100-8199 \
33
+ sigconverter.io
27
34
```
28
35
29
36
Visit the live instance at [ https://sigconverter.io ] ( https://sigconverter.io ) or locally at [ http://localhost:8000 ] ( http://localhost:8000 ) .
Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
- # Specify the directory to search in (or use the current directory)
3
+ # Specify the directory to search in
4
4
directory=" ./"
5
5
6
6
# Iterate over all subdirectories
7
7
for dir in " $directory " /* /; do
8
8
if [ -d " $dir " ]; then
9
9
version=$( basename $dir )
10
10
echo " Launching sigconverter backend for sigma version: $version "
11
+ # Add timeout to ensure previous instance has time to start
12
+ sleep 2
11
13
./$version /.venv/bin/python ./backend.py &
14
+
15
+ # Check if launch was successful
16
+ if [ $? -ne 0 ]; then
17
+ echo " Failed to launch backend for version $version "
18
+ fi
12
19
fi
13
20
done
21
+
22
+ # Wait for all backends to be ready
23
+ sleep 5
Original file line number Diff line number Diff line change @@ -18,9 +18,11 @@ def version_key(version):
18
18
def get_port_from_version (version ):
19
19
pattern = r"^\d+\.\d+\.\d+$"
20
20
if re .match (pattern , version ):
21
- return int (f'8{ version .replace ("." , "" )} ' )
22
- else :
23
- return None
21
+ try :
22
+ return int (f'8{ version .replace ("." , "" )} ' )
23
+ except ValueError :
24
+ return None
25
+ return None
24
26
25
27
26
28
@app .route ("/" )
You can’t perform that action at this time.
0 commit comments