From a050dcaf080fcfa01c7d173d1d7f8eb77498fea2 Mon Sep 17 00:00:00 2001 From: root Date: Mon, 4 Jan 2021 21:11:15 +0300 Subject: [PATCH] dockerfiles --- apps/Dockerfile-api | 19 +++++++++++++++++++ docker-compose-api.yml | 15 +++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 apps/Dockerfile-api create mode 100644 docker-compose-api.yml diff --git a/apps/Dockerfile-api b/apps/Dockerfile-api new file mode 100644 index 0000000..6fb4fa3 --- /dev/null +++ b/apps/Dockerfile-api @@ -0,0 +1,19 @@ +FROM python:3.8.3-alpine + +WORKDIR /usr/src/app +ENV PYTHONDONTWRITEBYTECODE 1 +ENV PYTHONUNBUFFERED 1 + +RUN apk update \ + && apk add gcc python3-dev musl-dev libffi-dev openssl-dev make + +COPY . . +WORKDIR api/api +RUN pip install --upgrade pip; pip install poetry; poetry config virtualenvs.create false; poetry install; poetry add uwsgi +CMD poetry shell; uwsgi --master \ + --single-interpreter \ + --workers $WORKERS \ + --gevent $ASYNC_CORES \ + --protocol http \ + --socket 0.0.0.0:$APP_PORT \ + --module patched:app diff --git a/docker-compose-api.yml b/docker-compose-api.yml new file mode 100644 index 0000000..5829542 --- /dev/null +++ b/docker-compose-api.yml @@ -0,0 +1,15 @@ +version: "3.3" +services: + api: + build: + context: ./apps + dockerfile: Dockerfile-api + environment: + - APP_PORT=8080 + - WORKERS=2 + - ASYNC_CORES=2000 + - NODE_NAME="Default node" + - NODE_LOCATION="Undefined location" + - ACCESS_TOKEN="CHANGE_TOKEN" + ports: + - "0.0.0.0:8080:8080"