This commit is contained in:
Adrian Amaglio 2020-04-30 17:24:13 +02:00
parent 6828c5684c
commit afdffffc3c
3 changed files with 9 additions and 2 deletions

View File

@ -14,4 +14,5 @@ COPY ./main.py ./list.tpl ./
# I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user # I juste wanted to change the socket owner but it turned out I needed to change thu uwsgi user
#CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app #CMD uwsgi --exec-asap 'chown $UID:$UID /tmp/uwsgi/ ; mkdir -p $BASE_PATH && chown $UID:$UID $BASE_PATH' -s /tmp/uwsgi/uwsgi.sock --uid $UID --manage-script-name --mount /=server:app
CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --mount $MOUNT=main:app # --log-master makes 500 error on 30s timeout for every valid http request
CMD uwsgi --chown-socket $UID -s /tmp/uwsgi/uwsgi.sock --manage-script-name --mount $MOUNT=main:app

5
build_docker.sh Executable file
View File

@ -0,0 +1,5 @@
set -e
version=2.0.1
docker build -t registry.jean-cloud.net/contact-mailer:latest -t registry.jean-cloud.net/contact-mailer:$version .
docker push registry.jean-cloud.net/contact-mailer:latest
docker push registry.jean-cloud.net/contact-mailer:$version

View File

@ -132,7 +132,8 @@ def submission ():
# Redirection # Redirection
#redirect(success_redirect_default) #redirect(success_redirect_default)
return 'Mail envoyé !' origin = request.headers.get('origin')
return 'Mail envoyé !' + ('Retour au <a href="{}">formulaire de contact</a>'.format(origin) if origin else '')
def get_fields (string): def get_fields (string):
""" Parse the string looking for template elements and create an array with template to fill and their default values. None if mandatory. """ """ Parse the string looking for template elements and create an array with template to fill and their default values. None if mandatory. """