Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
Librephotos Docker Scaling
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dev Ops
Librephotos Docker Scaling
Commits
acad4334
Commit
acad4334
authored
4 years ago
by
Matteo Parrucci
Browse files
Options
Downloads
Patches
Plain Diff
trying to add debug
parent
385515f5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
backend/Dockerfile
+3
-2
3 additions, 2 deletions
backend/Dockerfile
backend/entrypoint.sh
+7
-1
7 additions, 1 deletion
backend/entrypoint.sh
docker-compose.dev.yml
+3
-1
3 additions, 1 deletion
docker-compose.dev.yml
docker-compose.yml
+1
-0
1 addition, 0 deletions
docker-compose.yml
with
14 additions
and
4 deletions
backend/Dockerfile
+
3
−
2
View file @
acad4334
...
...
@@ -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
This diff is collapsed.
Click to expand it.
backend/entrypoint.sh
+
7
−
1
View file @
acad4334
#! /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
This diff is collapsed.
Click to expand it.
docker-compose.dev.yml
+
3
−
1
View file @
acad4334
...
...
@@ -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
This diff is collapsed.
Click to expand it.
docker-compose.yml
+
1
−
0
View file @
acad4334
...
...
@@ -76,6 +76,7 @@ services:
-
WEB_CONCURRENCY=${gunniWorkers}
-
WORKER_TIMEOUT=${workerTimeOut}
-
SKIP_PATTERNS=${skipPatterns}
-
DEBUG=0
# Wait for Postgres
depends_on
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment