-
Notifications
You must be signed in to change notification settings - Fork 5
Run with uWSGI usage #13
Changes from 8 commits
5ea9034
12a754c
4d97f9e
6b27ab8
c2ad6a7
68e363d
53ef3f2
439b7d2
b8cd2a5
926276b
e62e5a8
51bb963
ca2738e
6c56a2f
a53a011
e7ec57b
9403338
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
[uwsgi] | ||
chdir=/app | ||
pythonpath=/app | ||
virtualenv=/.venv | ||
wsgi-file=content_store/api/wsgi.py | ||
callable = APP | ||
|
||
http=0.0.0.0:80 | ||
master=True | ||
processes=4 | ||
max-requests=5000 | ||
#logto = uwsgi.log |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
ARG python_base_image_tag | ||
FROM python:${python_base_image_tag} | ||
|
||
# uwsgi build process dependencies | ||
RUN apk update && apk add gcc libc-dev linux-headers | ||
RUN pip install --no-cache-dir --only-binary --upgrade pipenv | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should merge the two There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can do, although there's not particular trigger that would re-execute these outside of the package names There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (can even merge 3) |
||
|
||
COPY Pipfile Pipfile.lock ./ | ||
RUN python -m venv /.venv | ||
ENV VIRTUAL_ENV=/.venv PYTHONUSERBASE=/.venv PATH=/.venv/bin:$PATH | ||
COPY Pipfile Pipfile.lock /pipfiles/ | ||
|
||
ARG pipenv_dev_arg | ||
ENV PIPENV_VENV_IN_PROJECT=1 | ||
WORKDIR /pipfiles | ||
RUN pipenv install ${pipenv_dev_arg} --deploy --ignore-pipfile |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from content_store.api.api import create_app | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The app shouldn't be in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. General structure (until there is logic to organize) still unclear, but a few (hopefully one) stable top-level package(s) is needed, the rest can be moved around |
||
|
||
APP = create_app() |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: '3' | ||
|
||
services: | ||
venv: | ||
volumes: | ||
- ./:/pipfiles/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,19 +9,19 @@ services: | |
pipenv_dev_arg: ${PIPENV_DEV_ARG} | ||
python_base_image_tag: ${PYTHON_BASE_IMAGE_TAG} | ||
image: libero/content-store_venv:${IMAGE_TAG} | ||
web: | ||
app: | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
args: | ||
image_tag: ${IMAGE_TAG} | ||
python_base_image_tag: ${PYTHON_BASE_IMAGE_TAG} | ||
image: libero/content-store:${IMAGE_TAG} | ||
environment: | ||
- FLASK_APP=content_store/api/api.py | ||
command: flask run --host=0.0.0.0 | ||
# TODO: check what to use for uwsgi | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was this resolved? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It works better with the current configuration, as the default There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (by default it will handle |
||
stop_signal: SIGINT | ||
volumes: | ||
- ./.docker/uwsgi.ini:/app/uwsgi.ini | ||
ports: | ||
- 5000:5000 | ||
- 5000:80 | ||
depends_on: | ||
- venv |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
--no-cache