add docker-compose
Marco Andronaco andronacomarco@gmail.com
Sun, 09 Jul 2023 17:18:09 +0200
4 files changed,
26 insertions(+),
3 deletions(-)
M
Dockerfile
→
Dockerfile
@@ -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.md
→
README.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