-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
27 lines (19 loc) · 843 Bytes
/
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
FROM python:3.12-alpine
MAINTAINER Kathryn Janzen <[email protected]>
COPY requirements.txt /
COPY deploy/run-server.sh /
COPY deploy/wait-for-it.sh /
COPY deploy/website.conf /etc/apache2/conf.d/zzzwebsite.conf
ADD . /website
RUN set -ex && \
apk add --no-cache --virtual libpq apache2-ssl apache2-mod-wsgi \
certbot-apache openssl bash sed py3-pip imagemagick && \
/usr/bin/python3 -m venv /venv && source /venv/bin/activate && \
/venv/bin/pip3 install --no-cache-dir --upgrade pip && \
/venv/bin/pip3 install --no-cache-dir -r /requirements.txt && \
mkdir -p /website/local && \
chmod -v +x /run-server.sh /wait-for-it.sh && \
sed -i -E 's@#!/usr/bin/env python@#!/venv/bin/python3@' /website/manage.py && \
/website/manage.py collectstatic --noinput
EXPOSE 443 80
CMD /run-server.sh