forked from RockefellerArchiveCenter/pisces
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.prod
32 lines (27 loc) · 897 Bytes
/
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
FROM python:3.9
ENV PYTHONUNBUFFERED 1
RUN apt-get update
RUN apt-get install --yes apache2 apache2-dev
RUN apt-get install --yes libapache2-mod-wsgi-py3
RUN apt-get -y install python3-pip
RUN pip install --upgrade pip
RUN pip install django
ADD ./apache/000-pisces.conf /etc/apache2/sites-available/000-pisces.conf
RUN a2dissite 000-default
RUN a2ensite 000-pisces.conf
RUN a2enmod headers
RUN a2enmod rewrite
RUN a2enmod wsgi
RUN mkdir -p /var/www/html/
COPY . /var/www/html/pisces
WORKDIR /var/www/html/pisces
RUN pip install -r requirements.txt
RUN ./manage.py collectstatic
RUN chmod 775 /var/www/html/pisces
RUN chgrp www-data /var/www/html/pisces
RUN chmod 775 /var/www/html/pisces/static
RUN chown www-data:www-data /var/www/html/pisces/static
RUN chmod 775 /var/www/html/pisces/pisces
RUN chgrp www-data /var/www/html/pisces/pisces
EXPOSE 8007
CMD ["apache2ctl", "-D", "FOREGROUND"]