mirror of
https://github.com/samuelclay/NewsBlur.git
synced 2025-04-13 09:42:01 +00:00
Fixing monitor to use new venv.
This commit is contained in:
parent
6c5aed53eb
commit
e55e6c3bd5
4 changed files with 23 additions and 15 deletions
|
@ -15,7 +15,7 @@
|
||||||
lineinfile:
|
lineinfile:
|
||||||
path: /srv/newsblur/newsblur_web/app_env.py
|
path: /srv/newsblur/newsblur_web/app_env.py
|
||||||
line: 'SERVER_NAME = "{{ inventory_hostname }}"'
|
line: 'SERVER_NAME = "{{ inventory_hostname }}"'
|
||||||
|
|
||||||
- name: Start monitor docker container
|
- name: Start monitor docker container
|
||||||
become: yes
|
become: yes
|
||||||
docker_container:
|
docker_container:
|
||||||
|
@ -23,7 +23,7 @@
|
||||||
image: newsblur/newsblur_monitor:latest
|
image: newsblur/newsblur_monitor:latest
|
||||||
pull: yes
|
pull: yes
|
||||||
state: started
|
state: started
|
||||||
command: bash -c "python /srv/newsblur/flask_monitor/db_monitor.py"
|
command: bash -c "/venv/bin/python /srv/newsblur/flask_monitor/db_monitor.py"
|
||||||
hostname: "{{ inventory_hostname }}"
|
hostname: "{{ inventory_hostname }}"
|
||||||
restart_policy: unless-stopped
|
restart_policy: unless-stopped
|
||||||
container_default_behavior: no_defaults
|
container_default_behavior: no_defaults
|
||||||
|
|
|
@ -23,14 +23,22 @@ RUN set -ex \
|
||||||
zlib1g-dev \
|
zlib1g-dev \
|
||||||
' \
|
' \
|
||||||
&& apt-get update \
|
&& apt-get update \
|
||||||
&& apt-get install -y $rundDeps $buildDeps --no-install-recommends \
|
&& apt-get install -y $rundDeps $buildDeps --no-install-recommends
|
||||||
&& pip install uv \
|
|
||||||
&& uv clean || true \
|
# Install uv
|
||||||
&& rm -rf /venv \
|
RUN pip install uv
|
||||||
&& uv venv /venv \
|
|
||||||
&& PATH="/venv/bin:$PATH" \
|
# Clean uv cache and any virtual environment from previous builds
|
||||||
&& VIRTUAL_ENV="/venv" \
|
RUN uv clean || true && rm -rf /venv
|
||||||
&& rm -rf /root/.cache/uv \
|
|
||||||
&& uv pip install -r requirements.txt \
|
# Create and activate virtual environment in /venv
|
||||||
&& apt-get purge -y --auto-remove ${buildDeps} \
|
RUN uv venv /venv
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
ENV PATH="/venv/bin:$PATH"
|
||||||
|
ENV VIRTUAL_ENV="/venv"
|
||||||
|
|
||||||
|
# Install dependencies
|
||||||
|
RUN rm -rf /root/.cache/uv && \
|
||||||
|
uv pip install -r requirements.txt
|
||||||
|
|
||||||
|
RUN apt-get purge -y --auto-remove ${buildDeps}
|
||||||
|
RUN rm -rf /var/lib/apt/lists/*
|
||||||
|
|
|
@ -256,7 +256,7 @@ def db_check_redis_pubsub():
|
||||||
@app.route("/db_check/elasticsearch")
|
@app.route("/db_check/elasticsearch")
|
||||||
def db_check_elasticsearch():
|
def db_check_elasticsearch():
|
||||||
try:
|
try:
|
||||||
conn = elasticsearch.Elasticsearch(f"{settings.SERVER_NAME}.node.nyc1.consul:9200")
|
conn = elasticsearch.Elasticsearch(f"http://{settings.SERVER_NAME}.node.nyc1.consul:9200")
|
||||||
except:
|
except:
|
||||||
abort(Response("Can't connect to db", 503))
|
abort(Response("Can't connect to db", 503))
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ flask>=2,<3
|
||||||
pymongo>=3.11.2,<4
|
pymongo>=3.11.2,<4
|
||||||
psycopg2>=2,<3
|
psycopg2>=2,<3
|
||||||
redis==3.5.3
|
redis==3.5.3
|
||||||
elasticsearch>=7,<8
|
elasticsearch>=8,<9
|
||||||
pymysql==0.10.1
|
pymysql==0.10.1
|
||||||
celery>=4,<5
|
celery>=4,<5
|
||||||
Django>=3.1,<3.2
|
Django>=3.1,<3.2
|
||||||
|
|
Loading…
Add table
Reference in a new issue