diff options
author | Marco Andronaco <andronacomarco@gmail.com> | 2023-07-09 17:18:09 +0200 |
---|---|---|
committer | Marco Andronaco <andronacomarco@gmail.com> | 2023-07-09 17:18:09 +0200 |
commit | 37dc1e94092a8d61633911f1f197cd695d4c2459 (patch) | |
tree | a7649e391b2a5c87187e39fad231fc4aa08b3e47 | |
parent | ab5a058087dbeccfc9b5041c5140bc9347b65fee (diff) | |
download | tnt-search-37dc1e94092a8d61633911f1f197cd695d4c2459.tar.gz |
add docker-compose
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Dockerfile | 9 | ||||
-rw-r--r-- | README.md | 12 | ||||
-rw-r--r-- | docker-compose.yaml | 7 |
4 files changed, 26 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore index 5ceb386..7f93ebf 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ venv +__pycache__ diff --git a/Dockerfile b/Dockerfile index 041998f..c8cb78f 100644 --- a/Dockerfile +++ b/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"] diff --git a/README.md b/README.md index 0f5fac2..46b6ab2 100644 --- a/README.md +++ b/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 ``` diff --git a/docker-compose.yaml b/docker-compose.yaml new file mode 100644 index 0000000..8d2b125 --- /dev/null +++ b/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 |