forked from readthedocs/readthedocs.org
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
81 lines (67 loc) · 2.22 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
FROM ubuntu:22.04
ARG GITHUB_USER
ARG GITHUB_TOKEN
ENV DEBIAN_FRONTEND noninteractive
ENV LANG en_US.UTF-8
ENV LANGUAGE en_US:en
ENV LC_ALL en_US.UTF-8
RUN apt-get -y update
RUN apt-get -y install \
curl \
g++ \
gettext \
git-core \
libevent-dev \
libpq-dev \
libxml2-dev \
libxslt1-dev \
locales \
build-essential \
python3-pip \
python3-dev \
postgresql-client \
libmysqlclient-dev \
libfreetype6 \
libjpeg-dev \
sqlite \
netcat \
telnet \
lsb-release \
npm \
rclone
# Dependencies for django-allauth SAML support.
# See:
# - https://github.com/SAML-Toolkits/python3-saml#installation
# - https://github.com/xmlsec/python-xmlsec#linux-debian
RUN apt-get -y install \
pkg-config \
libxml2-dev \
libxmlsec1-dev \
libxmlsec1-openssl
# Gets the MinIO mc client used to add buckets upon initialization
# If this client should have issues running inside this image, it is also
# fine to defer it to a separate image.
# The current minio/mc Docker image could be a lot smaller
RUN curl --disable https://dl.min.io/client/mc/release/linux-amd64/archive/mc.RELEASE.2022-06-11T21-10-36Z -o /usr/bin/mc && \
chmod +x /usr/bin/mc
RUN npm install -g nodemon
# Uncomment en_US.UTF-8 locale and generate it
RUN sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
RUN pip3 install --no-cache-dir --upgrade pip
# Ensure that ``python`` is in the PATH so that ``./manage.py`` works
RUN ln -s /usr/bin/python3 /usr/bin/python
WORKDIR /tmp
COPY requirements/pip.txt pip.txt
COPY requirements/docker.txt docker.txt
RUN pip3 install --no-cache-dir -r docker.txt
# Install readthedocs-ext only if GITHUB_TOKEN is provided
WORKDIR /usr/src/app/checkouts/
RUN if [ -n "$GITHUB_TOKEN" ] ; \
then \
git clone --depth 1 https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com/readthedocs/readthedocs-ext ; \
pip3 install --no-cache-dir -e readthedocs-ext ; \
fi
RUN git clone --depth 1 https://github.com/readthedocs/ext-theme ; \
pip3 install --no-cache-dir -e ext-theme
WORKDIR /usr/src/app/checkouts/readthedocs.org