generated from RockefellerArchiveCenter/nebula
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.prod
39 lines (32 loc) · 1.25 KB
/
Dockerfile.prod
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
FROM python:3.10
ENV PYTHONUNBUFFERED 1
ARG REQUEST_BROKER_DNS
ARG APPLICATION_PORT
RUN apt-get update
RUN apt-get install --yes apache2 apache2-dev
RUN apt-get install --yes postgresql
RUN apt-get -y install python3-pip
RUN apt-get -y install cron
RUN pip install --upgrade pip
RUN wget https://github.com/GrahamDumpleton/mod_wsgi/archive/refs/tags/4.9.0.tar.gz \
&& tar xvfz 4.9.0.tar.gz \
&& cd mod_wsgi-4.9.0 \
&& ./configure --with-apxs=/usr/bin/apxs --with-python=/usr/local/bin/python \
&& make \
&& make install \
&& make clean
ADD ./apache/000-request_broker.conf /etc/apache2/sites-available/000-request_broker.conf
RUN sed "s/ENV_REQUEST_BROKER_DNS/${REQUEST_BROKER_DNS}/" -i /etc/apache2/sites-available/000-request_broker.conf
RUN sed "s/ENV_REQUEST_BROKER_PORT/${APPLICATION_PORT}/" -i /etc/apache2/sites-available/000-request_broker.conf
ADD ./apache/wsgi.load /etc/apache2/mods-available/wsgi.load
RUN a2ensite 000-request_broker.conf
RUN a2enmod headers
RUN a2enmod rewrite
RUN a2enmod wsgi
COPY . /var/www/request-broker
WORKDIR /var/www/request-broker
RUN pip install -r requirements.txt
COPY --chmod=644 crontab /etc/cron.d/crontab
RUN crontab /etc/cron.d/crontab
EXPOSE ${APPLICATION_PORT}
ENTRYPOINT ["./entrypoint.prod.sh"]