forked from python-discord/forms-backend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 740 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 740 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
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 . .
# Set Git SHA build argument
ARG git_sha="development"
# Set Git SHA environment variable
ENV GIT_SHA=$git_sha
# Start the server with uvicorn
CMD ["gunicorn", "-w", "2", "-b", "0.0.0.0:8000", "-k", "uvicorn.workers.UvicornWorker", "backend:app"]