Skip to content

Commit

Permalink
Update Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
homanp committed Feb 22, 2024
1 parent ec5fe5e commit 977f03d
Showing 1 changed file with 4 additions and 13 deletions.
17 changes: 4 additions & 13 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
# Use an official Python runtime as a parent image
FROM python:3.11 AS builder

# Set the working directory in the container
WORKDIR /usr/src/app

# Copy the current directory contents into the container at /usr/src/app
COPY . /usr/src/app
# Copy the current directory contents into the container
COPY . .

# Install Poetry
RUN pip install poetry

ENV POETRY_NO_INTERACTION=1 \
POETRY_VIRTUALENVS_IN_PROJECT=1 \
POETRY_VIRTUALENVS_CREATE=1 \
POETRY_CACHE_DIR=/tmp/poetry_cache \
MAX_CONCURRENCY=20

# Copy only dependency files for layer caching
COPY pyproject.toml poetry.lock ./

# Install the required packages of the application into .venv
# Install the required packages of the application
RUN poetry install --no-root && rm -rf $POETRY_CACHE_DIR

# Make port 80 available to the world outside this container
ENV PORT="8080"

# Run app.py when the container launches
# Run main.py when the container launches
CMD exec gunicorn --bind :$PORT --workers 2 --timeout 0 --worker-class uvicorn.workers.UvicornWorker --threads 8 main:app

0 comments on commit 977f03d

Please sign in to comment.