diff --git a/backend/Dockerfile b/backend/Dockerfile new file mode 100644 index 000000000..9785b3e0c --- /dev/null +++ b/backend/Dockerfile @@ -0,0 +1,13 @@ +FROM condaforge/mambaforge:22.9.0-1 AS conda + +COPY environment.yml . +RUN mamba env create -p /env -f environment.yml && conda clean -afy + +FROM ubuntu:22.10 + +COPY --from=conda /env /env + +WORKDIR /app +COPY uwsgi.ini uwsgi.ini +COPY siarnaq siarnaq +CMD ["/env/bin/uwsgi", "--chdir=/app", "--uid=www-data", "--ini=uwsgi.ini"] diff --git a/backend/environment.yml b/backend/environment.yml new file mode 100644 index 000000000..ffedd9864 --- /dev/null +++ b/backend/environment.yml @@ -0,0 +1,19 @@ +name: siarnaq +channels: + - conda-forge +dependencies: + - ca-certificates=2022.9.24 + - django=4.1.2 + - django-cors-headers=3.13.0 + - djangorestframework=3.14.0 + - drf-spectacular=0.24.2 + - google-auth=2.13.0 + - google-cloud-pubsub=2.13.10 + - google-cloud-storage=2.5.0 + - openssl=3.0.5 + - pip=22.3 + - python=3.10 + - uwsgi=2.0.20 + - pip: + - djangorestframework-simplejwt==5.2.2 + - google-cloud-scheduler==2.7.3 diff --git a/backend/uwsgi.ini b/backend/uwsgi.ini new file mode 100644 index 000000000..95e7fec14 --- /dev/null +++ b/backend/uwsgi.ini @@ -0,0 +1,9 @@ +[uwsgi] +module=siarnaq.wsgi:application +master=true +pidfile=/tmp/project-master.pid +vacuum=true +max-requests=5000 +http-socket=:80 +processes=3 +harakiri=20