diff options
| author | 2020-11-26 18:56:56 +0000 | |
|---|---|---|
| committer | 2020-11-26 18:56:56 +0000 | |
| commit | 182da79739a134b8d574bf995601bc33b2f9a8c8 (patch) | |
| tree | 26c57af0d6b4fa7a6d4f7d2b578b741662c01bfc /Dockerfile | |
| parent | linebreak in SCHEMA.md (diff) | |
| parent | Add secretRef key to deployment.yaml (diff) | |
Merge pull request #1 from python-discord/docker-ci-deployment
Diffstat (limited to 'Dockerfile')
| -rw-r--r-- | Dockerfile | 27 | 
1 files changed, 27 insertions, 0 deletions
| diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..e463544 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,27 @@ +FROM python:3.9-slim + +# Allow service to handle stops gracefully +STOPSIGNAL SIGQUIT + +# Install C compiler and make +RUN apt-get update && \ +    apt-get install -y gcc make && \ +    apt-get clean && rm -rf /var/lib/apt/lists/* + +# Install Poetry +RUN pip install poetry + +# Copy dependencies-related files +COPY poetry.lock . +COPY pyproject.toml . + +# Install dependencies +RUN poetry config virtualenvs.create false +RUN poetry install --no-dev + +# Copy all files to container +WORKDIR /app +COPY . . + +# Start the server with uvicorn +CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "backend:app"] | 
