-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.webapp
More file actions
32 lines (24 loc) · 914 Bytes
/
Dockerfile.webapp
File metadata and controls
32 lines (24 loc) · 914 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
FROM python:3.11-slim
WORKDIR /app
# Install system dependencies and Poetry
RUN apt-get update && apt-get install -y \
postgresql-client \
curl \
&& rm -rf /var/lib/apt/lists/* \
&& curl -sSL https://install.python-poetry.org | python3 - \
&& ln -s /root/.local/bin/poetry /usr/local/bin/poetry
# Copy poetry files
COPY pyproject.toml poetry.lock* README.md ./
# Configure poetry
RUN poetry config virtualenvs.create false
# Install dependencies only (not the project itself yet)
RUN poetry install --no-interaction --no-ansi --no-root
# Copy only the modules the webapp needs
COPY src/__init__.py src/__init__.py
COPY src/webapp src/webapp
COPY src/db src/db
COPY src/models src/models
COPY src/utils src/utils
# Install the project now that source is available
RUN poetry install --no-interaction --no-ansi
CMD ["uvicorn", "src.webapp.app:app", "--host", "0.0.0.0", "--port", "8000"]