Changed start.sh to start.py

master
Ionut Filip 6 years ago
parent eb7dfb5771
commit 0e5606d493

@ -12,11 +12,11 @@ RUN apk add --no-cache openssl \
COPY mailu ./mailu
COPY migrations ./migrations
COPY manage.py .
COPY start.sh /start.sh
COPY start.py /start.py
RUN pybabel compile -d mailu/translations
EXPOSE 80/tcp
VOLUME ["/data"]
CMD ["/start.sh"]
CMD python /start.py

@ -0,0 +1,7 @@
#!/usr/bin/python3
import os
os.system("python manage.py advertise")
os.system("python manage.py db upgrade")
os.system("gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload mailu:app")

@ -1,5 +0,0 @@
#!/bin/sh
python manage.py advertise
python manage.py db upgrade
gunicorn -w 4 -b :80 --access-logfile - --error-logfile - --preload mailu:app

@ -3,9 +3,9 @@ FROM alpine:3.8
RUN apk add --no-cache clamav rsyslog wget clamav-libunrar
COPY conf /etc/clamav
COPY start.sh /start.sh
COPY start.py /start.py
EXPOSE 3310/tcp
VOLUME ["/data"]
CMD ["/start.sh"]
CMD /start.py

@ -0,0 +1,12 @@
#!/usr/bin/python3
import os
# Bootstrap the database if clamav is running for the first time
os.system("[ -f /data/main.cvd ] || freshclam")
# Run the update daemon
os.system("freshclam -d -c 6")
# Run clamav
os.system("clamd")

@ -1,10 +0,0 @@
#!/bin/sh
# Bootstrap the database if clamav is running for the first time
[ -f /data/main.cvd ] || freshclam
# Run the update daemon
freshclam -d -c 6
# Run clamav
clamd
Loading…
Cancel
Save