-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Rework the production and dev dockerfiles to make the analyzer optional - Tests/coverage/linting skip the analyzer module - Analyzer dependencies moved to their own requirement file
- Loading branch information
1 parent
e7641fe
commit 22f9d81
Showing
12 changed files
with
95 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,39 +3,52 @@ | |
# This Dockerfile is not currently used or maintained | ||
# but may be useful in setting up your own adserver instance. | ||
|
||
FROM python:3.8-alpine | ||
FROM ubuntu:20.04 | ||
MAINTAINER Read the Docs, Inc. <[email protected]> | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
ENV LANG en_US.UTF-8 | ||
ENV LANGUAGE en_US:en | ||
ENV LC_ALL en_US.UTF-8 | ||
ENV PYTHONUNBUFFERED 1 | ||
|
||
RUN apk update \ | ||
# psycopg2 dependencies | ||
&& apk add --virtual build-deps gcc python3-dev musl-dev \ | ||
&& apk add postgresql-dev \ | ||
# Pillow dependencies | ||
&& apk add jpeg-dev zlib-dev freetype-dev lcms2-dev openjpeg-dev tiff-dev tk-dev tcl-dev \ | ||
# CFFI dependencies | ||
&& apk add libffi-dev py-cffi \ | ||
# Translations dependencies | ||
&& apk add gettext \ | ||
# https://docs.djangoproject.com/en/dev/ref/django-admin/#dbshell | ||
&& apk add postgresql-client \ | ||
# Add Node dependencies for building static files | ||
&& apk add nodejs npm \ | ||
# Ensure git is on the system - some dependencies may rely on it | ||
&& apk add git \ | ||
# Needed to build Python Cryptography on Alpine Linux | ||
# https://cryptography.io/en/latest/installation.html#alpine | ||
&& apk add openssl-dev cargo | ||
|
||
RUN addgroup -S django \ | ||
&& adduser -S -G django django | ||
RUN apt-get -y update | ||
RUN apt-get -y install \ | ||
curl \ | ||
g++ \ | ||
git-core \ | ||
libevent-dev \ | ||
libpq-dev \ | ||
libxml2-dev \ | ||
libxslt1-dev \ | ||
locales \ | ||
build-essential \ | ||
python3-pip \ | ||
python3-dev \ | ||
libmysqlclient-dev \ | ||
libfreetype6 \ | ||
libjpeg-dev \ | ||
sqlite \ | ||
netcat \ | ||
telnet \ | ||
lsb-release | ||
|
||
# Install Node v14 | ||
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash - | ||
RUN apt-get -y install nodejs | ||
|
||
RUN addgroup django && useradd -g django django | ||
|
||
# Requirements are installed here to ensure they will be cached. | ||
COPY ./requirements /requirements | ||
# Uncomment this if you need the page/topic analyzer | ||
# RUN pip install --no-cache-dir -r /requirements/analyzer.txt | ||
RUN pip install --no-cache-dir -r /requirements/production.txt \ | ||
&& rm -rf /requirements | ||
|
||
# Install node dependencies | ||
RUN npm install | ||
|
||
COPY ./docker-compose/production/django/start /start | ||
RUN chmod +x /start | ||
RUN chown django /start | ||
|
@@ -60,19 +73,18 @@ COPY ./package.json /app | |
COPY ./package-lock.json /app | ||
COPY ./webpack.config.js /app | ||
|
||
# Uncomment if you require Azure's container SSH setup | ||
# Allow Azure to SSH into the running container | ||
# Although the root password is known, port 2222 is inaccessible from the internet | ||
# https://docs.microsoft.com/en-us/azure/app-service/containers/configure-custom-container#enable-ssh | ||
RUN apk add openssh \ | ||
&& echo "root:Docker!" | chpasswd | ||
COPY ./docker-compose/production/django/sshd_config /etc/ssh/ | ||
# RUN apk add openssh && echo "root:Docker!" | chpasswd | ||
# COPY ./docker-compose/production/django/sshd_config /etc/ssh/ | ||
|
||
RUN chown -R django:django /app | ||
USER django | ||
|
||
WORKDIR /app | ||
|
||
# Install node dependencies | ||
RUN npm install | ||
|
||
EXPOSE 2222 5000 | ||
|
||
CMD ["/start"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# Used by the keyword/topic analyzer | ||
beautifulsoup4==4.11.1 | ||
textacy==0.12.0 | ||
spacy==3.4.1 | ||
# Spacy transformers is listed in the production requirements | ||
# It installs PyTorch which is hundreds of MB | ||
langdetect==1.0.9 | ||
# Our use of textacy has an incompatibility with networkx v3 | ||
networkx<3.0 | ||
# Has to be downloaded directly like this (~30MB) | ||
https://github.com/explosion/spacy-models/releases/download/en_core_web_md-3.4.0/en_core_web_md-3.4.0-py3-none-any.whl | ||
|
||
|
||
####################################################################### | ||
# Machine learning production requirements | ||
####################################################################### | ||
# This installs PyTorch which is ~250MB | ||
spacy-transformers==1.1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,2 @@ | ||
# Tox will setup its own environment and so it doesn't depend on anything | ||
|
||
|
||
tox<4.0 |