BUYN-35 gunicron - Docker ready to deploy!
This commit is contained in:
parent
be8f6fce0c
commit
2f6263725c
@ -9,15 +9,17 @@ RUN apt-get update \
|
||||
|
||||
WORKDIR /install
|
||||
|
||||
COPY ./bk_api .
|
||||
COPY ./bk_api ./bk_api
|
||||
|
||||
RUN mv ./bk_api/ocr_module/tesseract_data/pol.traineddata /usr/share/tesseract-ocr/4.00/tessdata
|
||||
WORKDIR /install/bk_api
|
||||
|
||||
RUN mv ./ocr_module/tesseract_data/pol.traineddata /usr/share/tesseract-ocr/4.00/tessdata
|
||||
|
||||
RUN pip3 install pipenv_to_requirements gunicorn && \
|
||||
pipenv run pipenv_to_requirements && \
|
||||
pip3 install --no-cache -r requirements.txt
|
||||
|
||||
# WORKDIR /install
|
||||
CMD exec gunicorn bk_api.wsgi:application --bind 0.0.0.0:8000 --workers 3
|
||||
|
||||
|
||||
|
||||
|
6
Jenkinsfile
vendored
6
Jenkinsfile
vendored
@ -9,10 +9,10 @@ pipeline {
|
||||
}
|
||||
stage('Test') {
|
||||
steps {
|
||||
echo 'Testing..'
|
||||
echo '> Test tesseract installation...'
|
||||
sh 'sh scripts/check_tesseract.sh'
|
||||
sh 'ls -la /usr/share/tesseract-ocr/4.00/tessdata/'
|
||||
sh 'python api/main.py -i api/img/biedra.jpg'
|
||||
echo '> Test OCR api module...'
|
||||
sh 'python bk_api/ocr_module/main.py -i bk_api/ocr_module/img/biedra.jpg'
|
||||
}
|
||||
}
|
||||
}
|
||||
|
16
Makefile
Normal file
16
Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
.PHONY: build run logs
|
||||
|
||||
build:
|
||||
docker build --tag bk_api -f Dockerfile .
|
||||
|
||||
run:
|
||||
docker run -d --name api -p 127.0.0.1:3000:8000 bk_api
|
||||
|
||||
logs:
|
||||
docker logs api --follow
|
||||
|
||||
start:
|
||||
docker start api
|
||||
|
||||
stop:
|
||||
docker stop api
|
0
Pipfile.lock → bk_api/Pipfile.lock
generated
0
Pipfile.lock → bk_api/Pipfile.lock
generated
@ -13,6 +13,7 @@ Including another URLconf
|
||||
1. Import the include() function: from django.urls import include, path
|
||||
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
|
||||
"""
|
||||
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
|
||||
from django.contrib import admin
|
||||
from django.urls import include, path
|
||||
|
||||
@ -20,3 +21,5 @@ urlpatterns = [
|
||||
path('polls/', include('core.urls')),
|
||||
path('admin/', admin.site.urls),
|
||||
]
|
||||
|
||||
urlpatterns += staticfiles_urlpatterns()
|
||||
|
Loading…
Reference in New Issue
Block a user