-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
9 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,8 @@ FROM python:3.10-alpine | |
MAINTAINER Michael Büchner <[email protected]> | ||
ARG MEMEGEN_GIT_HASH=afefed2952658d9d2da78489aed493d964103400 | ||
RUN apk add \ | ||
freetype-dev \ | ||
jpeg-dev \ | ||
openjpeg \ | ||
libimagequant \ | ||
libjpeg-turbo \ | ||
|
@@ -16,14 +18,12 @@ RUN apk add \ | |
dpkg-dev dpkg \ | ||
expat-dev \ | ||
findutils \ | ||
freetype-dev \ | ||
fribidi-dev \ | ||
g++ \ | ||
gcc \ | ||
git \ | ||
gdbm-dev \ | ||
harfbuzz-dev \ | ||
jpeg-dev \ | ||
lcms2-dev \ | ||
libapparmor \ | ||
libc-dev \ | ||
|
@@ -52,6 +52,7 @@ RUN apk add \ | |
wget -O /home/memegen.zip https://github.com/jacebrowning/memegen/archive/$MEMEGEN_GIT_HASH.zip && \ | ||
unzip /home/memegen.zip -d /home && \ | ||
mv /home/memegen-$MEMEGEN_GIT_HASH/ /home/memegen/ && \ | ||
sed -i 's/Memegen.link/DDBmeme/g' /home/memegen/app/settings.py && \ | ||
rm -f /home/memegen.zip; | ||
|
||
WORKDIR /home/memegen | ||
|
@@ -63,25 +64,20 @@ ENV RUN_GROUP 0 | |
RUN mkdir .venv/ && \ | ||
chown -R ${RUN_USER}:${RUN_GROUP} . && \ | ||
python3 -m pip install --no-cache --upgrade pipenv poetry && \ | ||
{ \ | ||
echo "WEB_CONCURRENCY=2"; \ | ||
echo "MAX_REQUESTS=0"; \ | ||
echo "MAX_REQUESTS_JITTER=0"; \ | ||
echo "WATERMARK_OPTIONS=blank,DDBmeme"; \ | ||
} > .env && \ | ||
pipenv install && \ | ||
pipenv run poetry install; | ||
|
||
# add supervisord config | ||
COPY --chown=${RUN_USER}:${RUN_GROUP} config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
# add DDBmeme and build it | ||
COPY --chown=${RUN_USER}:${RUN_GROUP} DDBmeme/ /home/ddbmeme/ | ||
WORKDIR /home/ddbmeme | ||
RUN mkdir .venv/ && \ | ||
pipenv install && \ | ||
pipenv run python manage.py migrate && \ | ||
apk del --no-network .build-deps && \ | ||
pipenv run python manage.py migrate; | ||
|
||
# add supervisord config | ||
COPY --chown=${RUN_USER}:${RUN_GROUP} config/supervisord.conf /etc/supervisor/conf.d/supervisord.conf | ||
|
||
RUN apk del --no-network .build-deps && \ | ||
touch /run/supervisord.pid && chgrp -R ${RUN_GROUP} /run/supervisord.pid && chmod -R g=u /run/supervisord.pid; | ||
|
||
CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] | ||
|