all repos — tnt-search @ 37dc1e94092a8d61633911f1f197cd695d4c2459

A search tool for TNTVillage's dump.

add docker-compose
Marco Andronaco andronacomarco@gmail.com
Sun, 09 Jul 2023 17:18:09 +0200
commit

37dc1e94092a8d61633911f1f197cd695d4c2459

parent

ab5a058087dbeccfc9b5041c5140bc9347b65fee

4 files changed, 26 insertions(+), 3 deletions(-)

jump to
M .gitignore.gitignore

@@ -1,1 +1,2 @@

venv +__pycache__
M DockerfileDockerfile

@@ -1,6 +1,11 @@

FROM python:3-alpine -COPY . . +COPY main.py . +COPY requirements.txt . +COPY tntvillage-release-dump ./tntvillage-release-dump +COPY templates ./templates + RUN pip install --upgrade pip RUN pip install -r requirements.txt -CMD ["waitress-serve", "--host", "127.0.0.1", "--port", "5000", "main:app"] + +CMD ["waitress-serve", "--host", "0.0.0.0", "--port", "5000", "main:app"]
M README.mdREADME.md

@@ -12,7 +12,17 @@ waitress-serve --host 127.0.0.1 --port 5000 main:app

``` ### Docker +Build image: ``` docker build -t tnt-search . -docker run -d -p 5000:5000 tnt-search +``` + +Then, either use Docker CLI: +``` +docker run -d --name tnt-search --restart unless-stopped -p 5000:5000 tnt-search +``` + +Or, better, docker-compose (already set up for reverse-proxy only): +``` +docker-compose up -d ```
A docker-compose.yaml

@@ -0,0 +1,7 @@

+services: + tnt-search: + image: tnt-search + container_name: tnt-search + ports: + - "127.0.0.1:5000:5000" # Replace with "5000:5000" if you don't use a reverse proxy + restart: unless-stopped