Skip to content

Commit

Permalink
Docker: Split docs generation
Browse files Browse the repository at this point in the history
Minimises runtime installed dependencies
  • Loading branch information
ukanga committed May 20, 2024
1 parent d721e49 commit 90a7b79
Show file tree
Hide file tree
Showing 10 changed files with 135 additions and 144 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@
onadata/media
onadata/test_data_media
onadata/test_media
docs/_build
16 changes: 12 additions & 4 deletions docker/onadata-uwsgi/Dockerfile.ubuntu
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ RUN apt-get update -q && \
automake

# Generate and set en_US.UTF-8 locale
RUN locale-gen en_US.UTF-8
RUN sed -i '/en_US.UTF-8/s/^# //g' /etc/locale.gen && \
locale-gen en_US.UTF-8
ENV LC_ALL en_US.UTF-8
ENV LC_CTYPE en_US.UTF-8
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
RUN dpkg-reconfigure locales


Expand Down Expand Up @@ -101,19 +104,24 @@ RUN python -m pip install --no-cache-dir -U pip && \
python -m pip install --no-cache-dir -r requirements/ses.pip && \
python -m pip install --no-cache-dir -r requirements/azure.pip && \
python -m pip install --no-cache-dir setuptools==69.2.0 && \
python -m pip install --no-cache-dir pyyaml==6.0.1 uwsgitop==0.12
python -m pip install --no-cache-dir pyyaml==6.0.1 uwsgitop==0.12 supervisor==4.2.5

FROM base as docs

ENV PYENV_ROOT="$HOME/.pyenv"
ENV PATH $PYENV_ROOT/versions/3.10.14/bin:$PYENV_ROOT/shims:$PYENV_ROOT/bin:$PATH
COPY --from=base /home/onadata/.pyenv/ /home/onadata/.pyenv/
COPY --from=base /srv/onadata/ /srv/onadata/

USER root

RUN chown -R onadata:onadata /srv/onadata/

USER onadata

# Compile API Docs
RUN make -C docs html
# install sphinx and build API docs.
RUN python -m pip install --no-cache-dir -r requirements/docs.pip && \
make -C docs html


FROM ubuntu:jammy-20240405 as runtime
Expand Down
12 changes: 6 additions & 6 deletions requirements/azure.pip
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,31 @@ cffi==1.16.0
# via cryptography
charset-normalizer==3.3.2
# via requests
cryptography==42.0.5
cryptography==42.0.6
# via
# -r requirements/azure.in
# azure-storage-blob
django==4.2.11
# via
# -r requirements/azure.in
# django-storages
django-storages==1.14.2
django-storages==1.14.3
# via -r requirements/azure.in
idna==3.6
idna==3.7
# via requests
isodate==0.6.1
# via azure-storage-blob
pycparser==2.21
pycparser==2.22
# via cffi
requests==2.31.0
# via azure-core
six==1.16.0
# via
# azure-core
# isodate
sqlparse==0.4.4
sqlparse==0.5.0
# via django
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# azure-core
# azure-storage-blob
Expand Down
77 changes: 22 additions & 55 deletions requirements/base.pip
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
#
-e git+https://github.com/onaio/savreaderwriter.git@fix-pep-440-issues#egg=savreaderwriter
# via -r requirements/base.in
alabaster==0.7.16
# via sphinx
amqp==5.2.0
# via kombu
analytics-python==1.4.post1
Expand All @@ -23,23 +21,21 @@ attrs==23.2.0
# jsonlines
# jsonschema
# referencing
babel==2.14.0
# via sphinx
backoff==1.10.0
# via analytics-python
billiard==4.2.0
# via celery
boto3==1.34.71
boto3==1.34.98
# via dataflows-tabulator
botocore==1.34.71
botocore==1.34.98
# via
# boto3
# s3transfer
cached-property==1.5.2
# via tableschema
cachetools==5.3.3
# via google-auth
celery==5.3.6
celery==5.4.0
# via onadata
certifi==2024.2.2
# via
Expand Down Expand Up @@ -68,7 +64,7 @@ click-plugins==1.1.1
# via celery
click-repl==0.3.0
# via celery
cryptography==42.0.5
cryptography==42.0.6
# via
# jwcrypto
# onadata
Expand Down Expand Up @@ -159,16 +155,14 @@ djangorestframework-gis==1.0
# via onadata
djangorestframework-guardian==0.3.0
# via onadata
djangorestframework-jsonapi==6.1.0
djangorestframework-jsonapi==7.0.0
# via onadata
djangorestframework-jsonp==1.0.2
# via onadata
djangorestframework-xml==2.0.0
# via onadata
dnspython==2.6.1
# via pymongo
docutils==0.19
# via sphinx
dpath==2.1.6
# via onadata
elaphe3==0.2.0
Expand All @@ -193,46 +187,40 @@ hiredis==2.3.2
# via redis
httplib2==0.22.0
# via onadata
idna==3.6
idna==3.7
# via requests
ijson==3.2.3
# via dataflows-tabulator
imagesize==1.4.1
# via sphinx
inflection==0.5.1
# via djangorestframework-jsonapi
isodate==0.6.1
# via tableschema
jinja2==3.1.3
# via sphinx
jmespath==1.0.1
# via
# boto3
# botocore
jsonlines==4.0.0
# via dataflows-tabulator
jsonpickle==3.0.3
jsonpickle==3.0.4
# via onadata
jsonpointer==2.4
# via datapackage
jsonschema==4.21.1
jsonschema==4.22.0
# via
# datapackage
# tableschema
jsonschema-specifications==2023.12.1
# via jsonschema
jwcrypto==1.5.6
# via django-oauth-toolkit
kombu==5.3.5
kombu==5.3.7
# via celery
linear-tsv==1.1.0
# via dataflows-tabulator
lxml==5.1.0
lxml==5.2.1
# via onadata
markdown==3.6
# via onadata
markupsafe==2.1.5
# via jinja2
modilabs-python-utils==0.1.5
# via onadata
monotonic==1.6
Expand All @@ -252,11 +240,9 @@ openpyxl==3.0.9
# dataflows-tabulator
# onadata
# pyxform
packaging==24.0
# via sphinx
paho-mqtt==2.0.0
paho-mqtt==2.1.0
# via onadata
pillow==10.2.0
pillow==10.3.0
# via
# elaphe3
# onadata
Expand All @@ -270,19 +256,17 @@ pyasn1==0.6.0
# rsa
pyasn1-modules==0.4.0
# via google-auth
pycparser==2.21
pycparser==2.22
# via cffi
pyfloip @ git+https://github.com/onaio/floip-py.git@3c980eb184069ae7c3c9136b18441978237cd41d
# via -r requirements/base.in
pygments==2.17.2
# via sphinx
pyjwt==2.8.0
# via
# ona-oidc
# onadata
pylibmc==1.6.3
# via onadata
pymongo==4.6.2
pymongo==4.7.1
# via onadata
pyparsing==3.1.2
# via httplib2
Expand Down Expand Up @@ -310,11 +294,11 @@ pyxform==1.12.2
# pyfloip
recaptcha-client==1.0.6
# via onadata
redis==5.0.3
redis==5.0.4
# via
# django-redis
# onadata
referencing==0.34.0
referencing==0.35.1
# via
# jsonschema
# jsonschema-specifications
Expand All @@ -328,7 +312,6 @@ requests==2.31.0
# onadata
# python-json2xlsclient
# requests-oauthlib
# sphinx
# tableschema
requests-oauthlib==2.0.0
# via google-auth-oauthlib
Expand All @@ -342,7 +325,7 @@ rsa==4.9
# via google-auth
s3transfer==0.10.1
# via boto3
sentry-sdk==1.43.0
sentry-sdk==1.45.0
# via onadata
simplejson==3.19.2
# via onadata
Expand All @@ -356,31 +339,15 @@ six==1.16.0
# linear-tsv
# python-dateutil
# tableschema
snowballstemmer==2.2.0
# via sphinx
sphinx==6.2.1
# via onadata
sphinxcontrib-applehelp==1.0.8
# via sphinx
sphinxcontrib-devhelp==1.0.6
# via sphinx
sphinxcontrib-htmlhelp==2.0.5
# via sphinx
sphinxcontrib-jsmath==1.0.1
# via sphinx
sphinxcontrib-qthelp==1.0.7
# via sphinx
sphinxcontrib-serializinghtml==1.1.10
# via sphinx
sqlalchemy==2.0.29
sqlalchemy==2.0.30
# via dataflows-tabulator
sqlparse==0.4.4
sqlparse==0.5.0
# via
# django
# django-debug-toolbar
tableschema==1.20.10
tableschema==1.20.11
# via datapackage
typing-extensions==4.10.0
typing-extensions==4.11.0
# via
# jwcrypto
# sqlalchemy
Expand All @@ -399,7 +366,7 @@ urllib3==2.2.1
# botocore
# requests
# sentry-sdk
uwsgi==2.0.24
uwsgi==2.0.25.1
# via onadata
vine==5.1.0
# via
Expand Down
Loading

0 comments on commit 90a7b79

Please sign in to comment.