Skip to content
Snippets Groups Projects
Commit acad4334 authored by Matteo Parrucci's avatar Matteo Parrucci
Browse files

trying to add debug

parent 385515f5
No related branches found
No related tags found
No related merge requests found
......@@ -12,13 +12,14 @@ RUN curl -SL https://s3.eu-central-1.amazonaws.com/ownphotos-deploy/places365_mo
RUN curl -SL https://s3.eu-central-1.amazonaws.com/ownphotos-deploy/im2txt_model.tar.gz | tar -zxC /data_models/im2txt/
RUN curl -SL https://s3.eu-central-1.amazonaws.com/ownphotos-deploy/im2txt_data.tar.gz | tar -zxC /data_models/im2txt/
RUN curl -SL https://download.pytorch.org/models/resnet152-b121ed2d.pth -o /root/.cache/torch/hub/checkpoints/resnet152-b121ed2d.pth
RUN pip install torch==1.7.1+cpu torchvision==0.8.2+cpu -f https://download.pytorch.org/whl/torch_stable.html
# actual project
WORKDIR /code
RUN git clone https://github.com/LibrePhotos/librephotos.git .
RUN git clone https://github.com/parruc/librephotos .
RUN pip install -r requirements.txt
RUN python -m spacy download en_core_web_sm
EXPOSE 80
# TODO: prod vs dev requirements using docker-compose args
# TODO: in dev copiare anche i vscode settings
\ No newline at end of file
# TODO: in dev copiare anche i vscode settings
#! /bin/bash
export PYTHONUNBUFFERED=TRUE
pip install torch==1.7.1+cpu torchvision==0.8.2+cpu faiss-cpu django-picklefield
mkdir -p /logs
python image_similarity/main.py 2>&1 | tee /logs/gunicorn_image_similarity.log &
......@@ -13,4 +15,8 @@ python manage.py createadmin -u $ADMIN_USERNAME $ADMIN_EMAIL 2>&1 | tee /logs/co
echo "Running backend server..."
python manage.py rqworker default 2>&1 | tee /logs/rqworker.log &
gunicorn --worker-class=gevent --timeout $WORKER_TIMEOUT --bind backend:8001 --log-level=info ownphotos.wsgi 2>&1 | tee /logs/gunicorn_django.log
\ No newline at end of file
if [ $(ps -ef | grep -c "myApplication") -eq 1 ]; then echo "true"; fi
[ "$DEBUG" = 1 ] && RELOAD=" --reload" || RELOAD=""
gunicorn --worker-class=gevent --timeout $WORKER_TIMEOUT $RELOAD --bind backend:8001 --log-level=info ownphotos.wsgi 2>&1 | tee /logs/gunicorn_django.log
......@@ -24,6 +24,8 @@ services:
backend:
tty: true
environment:
- DEBUG=1
build:
context: .
dockerfile: backend/Dockerfile
......@@ -45,4 +47,4 @@ services:
- $HOME/pgadmin:/root/.pgadmin
ports:
- "3001:80"
restart: unless-stopped
\ No newline at end of file
restart: unless-stopped
......@@ -76,6 +76,7 @@ services:
- WEB_CONCURRENCY=${gunniWorkers}
- WORKER_TIMEOUT=${workerTimeOut}
- SKIP_PATTERNS=${skipPatterns}
- DEBUG=0
# Wait for Postgres
depends_on:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment