forked from crestalnetwork/intentkit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (35 loc) · 1.15 KB
/
Dockerfile
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
34
35
36
37
38
39
40
41
42
43
44
45
# Use Python slim image as the base
FROM python:3.12-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.8.5 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1
# Add Poetry to PATH
ENV PATH="$POETRY_HOME/bin:$PATH"
# Install system dependencies and Poetry
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
curl \
build-essential \
libpq-dev \
&& curl -sSL https://install.python-poetry.org | python3 - --version $POETRY_VERSION \
&& apt-get purge -y --auto-remove curl \
&& rm -rf /var/lib/apt/lists/*
# Set the working directory in the container
WORKDIR /app
# Copy Poetry configuration files
COPY pyproject.toml poetry.lock* ./
# Install dependencies
RUN poetry install --no-root --no-dev
# Copy the rest of the application code into the container
COPY . .
# Install the project
RUN poetry install --no-dev
ARG RELEASE
ENV RELEASE=$RELEASE
# Command to run the application using Poetry
CMD ["poetry", "run", "uvicorn", "app.api:app", "--host", "0.0.0.0", "--port", "80"]