hopes and dreams

This commit is contained in:
Patrick 2024-11-12 22:07:35 +01:00
parent e3b1ac8bd1
commit 8f021fabf3
9 changed files with 23 additions and 26 deletions

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
FROM python
WORKDIR /usr/local/app
COPY src ./
RUN pip install --no-cache-dir -r requirements.txt
EXPOSE 5000
RUN useradd app
USER app
CMD ["gunicorn","-w 2", "-b 0.0.0.0:5000", "wsgi:app"]

11
Makefile Normal file
View file

@ -0,0 +1,11 @@
APPLICATION = vm-experiments/jet-search
APP = jet-search
build:
docker build -t $(APPLICATION) .
docker save -o $(APPLICATION).tar $(APPLICATION)
install:
cp nginx /etc/nginx/sites-enabled/$(APP)
docker load -i $(APPLICATION)
docker run --name $(APPLICATION) --restart always -d $(APPLICATION)

View file

@ -1,13 +0,0 @@
[Unit]
Description=JetSearch Service
After=network.target
[Service]
User=root
Group=root
WorkingDirectory=/root/jet-search
Environment="PATH=/root/jet-search/venv/bin"
ExecStart=/root/jet-search/venv/bin/gunicorn wsgi:app -b '127.0.0.1:5000'
[Install]
WantedBy=multi-user.target

View file

@ -1,13 +0,0 @@
#!/bin/bash
# This file is part of VM-Experiments.
# Licensed under the AGPL-3.0-or-later. See LICENSE for details.
cd /root/jet-search/deploy/
mv jet-search /etc/nginx/sites-enabled/
mv jet-search.service /etc/systemd/system/
systemctl enable jet-search.service
cd ..
python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt