From afc6cf6f91b2cd0511a3768825a558f507ce2d9d Mon Sep 17 00:00:00 2001 From: Viet Nguyen Date: Wed, 11 Dec 2024 15:13:29 +1100 Subject: [PATCH] update docker --- Dockerfile | 16 +++++++++------- pyproject.toml | 1 - 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/Dockerfile b/Dockerfile index bfd60e1..4adf388 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,22 +1,24 @@ -# Use the official Python base image +# Build stage FROM python:3.10-slim # Set the working directory in the container WORKDIR /app -# Copy the pyproject.toml and poetry.lock files into the container +# Copy only necessary files for dependency installation COPY pyproject.toml poetry.lock ./ -# Install system dependencies and Python dependencies +# Install system dependencies and Poetry RUN apt update && \ - apt -y upgrade && \ + apt -y install --no-install-recommends curl build-essential && \ pip3 install --upgrade pip && \ pip3 install poetry && \ poetry config virtualenvs.create false && \ poetry lock && \ - poetry install + poetry install && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/* -# Copy the rest of the application code into the container +# Copy the rest of the application code COPY . /app # Make sure log config file (if provided) is available in the working directory @@ -25,7 +27,7 @@ COPY log_config.yaml /app/log_config.yaml # Expose the port the app runs on EXPOSE 8000 -# Set environment variables from a .env file or directly +# Set environment variables ENV GUNICORN_TIMEOUT=3600 ENV GUNICORN_WORKERS_NUM=4 diff --git a/pyproject.toml b/pyproject.toml index d7856e5..f9a363a 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -3,7 +3,6 @@ name = "data-discovery-ai" version = "0.1.0" description = "" authors = ["Viet Nguyen "] -readme = "README.md" [tool.poetry.dependencies] python = "~3.10"