Fix docker runtime support
This commit is contained in:
parent
19ce328596
commit
efbda23c38
@ -3,11 +3,11 @@ FROM python:3.11-slim
|
|||||||
# Get runtime dependencies
|
# Get runtime dependencies
|
||||||
# glx for OpenCV, ghostscript for datasheet PDF rendering, zbar for barcode scanning, git for cloning repos
|
# glx for OpenCV, ghostscript for datasheet PDF rendering, zbar for barcode scanning, git for cloning repos
|
||||||
RUN apt-get update && apt-get install -y libgl1-mesa-glx ghostscript libzbar0 git && apt-get clean && rm -rf /var/lib/apt/lists
|
RUN apt-get update && apt-get install -y libgl1-mesa-glx ghostscript libzbar0 git && apt-get clean && rm -rf /var/lib/apt/lists
|
||||||
COPY *.py *.yml *.sh *.txt *.html static templates ./
|
COPY requirements.txt ./
|
||||||
#COPY config-server.yml config.yml
|
#COPY config-server.yml config.yml
|
||||||
RUN pip3 install -r requirements.txt
|
RUN pip3 install -r requirements.txt
|
||||||
|
COPY *.py *.yml *.sh *.txt *.html static templates ./
|
||||||
CMD ["python3", "run.py"]
|
CMD ["sh", "-c", "python3 run.py"]
|
||||||
EXPOSE 5000
|
EXPOSE 5000
|
||||||
EXPOSE 8000
|
EXPOSE 8000
|
||||||
EXPOSE 9000
|
EXPOSE 9000
|
||||||
|
12
compose.yml
12
compose.yml
@ -9,5 +9,17 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- "meili_data:/meili_data"
|
- "meili_data:/meili_data"
|
||||||
|
|
||||||
|
jukebox-software:
|
||||||
|
build: .
|
||||||
|
init: true
|
||||||
|
ports:
|
||||||
|
- "5000:5000"
|
||||||
|
- "8000:8000"
|
||||||
|
- "9000:9000"
|
||||||
|
environment:
|
||||||
|
- PYTHONUNBUFFERED=1
|
||||||
|
depends_on:
|
||||||
|
- meilisearch
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
meili_data:
|
meili_data:
|
11
run.py
11
run.py
@ -26,7 +26,7 @@ import json
|
|||||||
import process_video
|
import process_video
|
||||||
import search
|
import search
|
||||||
from search import JukeboxSearch
|
from search import JukeboxSearch
|
||||||
|
#multiprocessing.set_start_method('spawn', True)
|
||||||
|
|
||||||
|
|
||||||
config = None
|
config = None
|
||||||
@ -581,7 +581,7 @@ if __name__ == "__main__":
|
|||||||
with open('config.yml', 'r') as fileread:
|
with open('config.yml', 'r') as fileread:
|
||||||
#global config
|
#global config
|
||||||
config = yaml.safe_load(fileread)
|
config = yaml.safe_load(fileread)
|
||||||
|
fprint("Config loaded.")
|
||||||
with Manager() as manager:
|
with Manager() as manager:
|
||||||
fprint("Spawning threads...")
|
fprint("Spawning threads...")
|
||||||
pool = LoggingPool(processes=10)
|
pool = LoggingPool(processes=10)
|
||||||
@ -602,5 +602,12 @@ if __name__ == "__main__":
|
|||||||
fprint("Entering main loop...")
|
fprint("Entering main loop...")
|
||||||
while(keeprunning):
|
while(keeprunning):
|
||||||
mainloop_server(pool)
|
mainloop_server(pool)
|
||||||
|
else:
|
||||||
|
fprint("Mode unspecified - assuming server")
|
||||||
|
fprint("Starting in server mode.")
|
||||||
|
if setup_server(pool):
|
||||||
|
fprint("Entering main loop...")
|
||||||
|
while(keeprunning):
|
||||||
|
mainloop_server(pool)
|
||||||
|
|
||||||
|
|
||||||
|
@ -6,7 +6,7 @@ from meilisearch.task import TaskInfo
|
|||||||
from meilisearch.errors import MeilisearchApiError
|
from meilisearch.errors import MeilisearchApiError
|
||||||
import time
|
import time
|
||||||
|
|
||||||
DEFAULT_URL = "http://localhost:7700"
|
DEFAULT_URL = "http://meilisearch:7700"
|
||||||
DEFAULT_APIKEY = "fluffybunnyrabbit" # I WOULD RECOMMEND SOMETHING MORE SECURE
|
DEFAULT_APIKEY = "fluffybunnyrabbit" # I WOULD RECOMMEND SOMETHING MORE SECURE
|
||||||
DEFAULT_INDEX = "cables"
|
DEFAULT_INDEX = "cables"
|
||||||
DEFAULT_FILTERABLE_ATTRS = ["partnum", "uuid", "position"] # default filterable attributes
|
DEFAULT_FILTERABLE_ATTRS = ["partnum", "uuid", "position"] # default filterable attributes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user