Fitxers de deploy

This commit is contained in:
2021-11-27 13:09:11 +01:00
parent 7a8ae86a1c
commit 5729cbe18a
4 changed files with 34 additions and 0 deletions

14
deploy/Dockerfile Normal file
View File

@@ -0,0 +1,14 @@
FROM python:3.8
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY main.py .
COPY static .
COPY templates .
COPY deploy/presencia.ini .
CMD ["uwsgi", "--ini", "presencia.ini"]

10
deploy/presencia.ini Normal file
View File

@@ -0,0 +1,10 @@
[uwsgi]
module = main:app
chown = www-data:www-data
uid = www-data
gid = www-data
chdir = /app/
processes = 4
threads = 2
socket = 0.0.0.0:5000
wsgi-disable-file-wrapper = false

9
deploy/publish.sh Executable file
View File

@@ -0,0 +1,9 @@
#!/bin/bash
set -e
# BUILD
docker build . -f deploy/Dockerfile -t presencia
# PUBLISH
docker tag presencia marc.sastre.cat/presencia
docker push marc.sastre.cat/presencia