forked from nvollmar/docker-bounca
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
42 lines (36 loc) · 1.88 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
FROM nginx:latest
ARG BOUNCA_FILE_VERSION=102483429
ENV BOUNCA_FILE_VERSION=${BOUNCA_FILE_VERSION} \
DOCROOT=/srv/www/bounca \
LOGDIR=/var/log/bounca \
ETCDIR=/etc/bounca \
UWSGIDIR=/etc/uwsgi \
NGINXDIR=/etc/nginx \
BOUNCA_USER=www-data \
BOUNCA_GROUP=www-data
COPY files/bounca-config.sh /docker-entrypoint.d/bounca-config.sh
RUN apt-get update && \
apt-get install -qy \
gettext netcat-traditional nginx python3 python3-dev python3-setuptools \
python-is-python3 uwsgi uwsgi-plugin-python3 python3-pip \
wget ca-certificates openssl python3-psycopg2 && \
mkdir -pv ${LOGDIR} ${DOCROOT} ${ETCDIR} /etc/nginx/sites-available /etc/nginx/sites-enabled && \
wget -P /tmp --content-disposition https://gitlab.com/bounca/bounca/-/package_files/${BOUNCA_FILE_VERSION}/download && \
tar -xzvf /tmp/bounca.tar.gz -C /srv/www && \
pip install --no-cache-dir --break-system-packages -r ${DOCROOT}/requirements.txt && \
rm -rfv /etc/nginx/conf.d && \
ln -s /etc/nginx/sites-enabled /etc/nginx/conf.d && \
cp -v ${DOCROOT}/etc/nginx/bounca /etc/nginx/sites-available/bounca.conf && \
ln -s /etc/nginx/sites-available/bounca.conf /etc/nginx/sites-enabled/bounca.conf && \
cp -v ${DOCROOT}/etc/uwsgi/bounca.ini /etc/uwsgi/apps-available/bounca.ini && \
ln -s /etc/uwsgi/apps-available/bounca.ini /etc/uwsgi/apps-enabled/bounca.ini && \
chown -R ${BOUNCA_USER}:${BOUNCA_GROUP} ${LOGDIR} ${DOCROOT} ${ETCDIR} ${UWSGIDIR} \
${NGINXDIR} /var/run /var/cache/nginx && \
sed -i '/psycopg2-binary/d' ${DOCROOT}/requirements.txt && \
chmod +x /docker-entrypoint.d/bounca-config.sh && \
ln -sfT /dev/stdout "/var/log/nginx/bounca-access.log" && \
ln -sfT /dev/stdout "/var/log/nginx/bounca-error.log" && \
apt-get clean && \
rm -rfv /tmp/* /var/tmp/* /var/lib/apt/lists/* ${DOCROOT}/.git
WORKDIR ${DOCROOT}
EXPOSE 8080