If you have Docker Desktop installed, you can dockerize your Python project and replace `sample_project` with your name:
```Dockerfile
cat << DOCKERFILE > Dockerfile
FROM python:3.11.5-slim-bookworm as python-base
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
POETRY_HOME="/opt/poetry" \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
PYSETUP_PATH="/opt/pysetup" \
VENV_PATH="/opt/pysetup/.venv"
ENV PATH="$POETRY_HOME/bin:$VENV_PATH/bin:$PATH"
FROM python-base as builder-base
RUN apt-get update \
&& apt-get install --no-install-recommends -y \
curl \
build-essential
ENV POETRY_VERSION=1.6.1
RUN curl -sSL https://install.python-poetry.org | python
WORKDIR $PYSETUP_PATH
COPY ./poetry.lock ./pyproject.toml ./
RUN poetry install --no-root --no-dev
FROM builder-base as development
RUN poetry install --no-root
COPY . .
RUN poetry install
CMD ["python3","-m", "sample_project.main"]
FROM python-base as production
COPY --from=builder-base $VENV_PATH $VENV_PATH
WORKDIR $PYSETUP_PATH
COPY ./sample_project ./sample_project
USER 10000
CMD ["python3","-m", "sample_project.main"]
DOCKERFILE
```
Then to build the project, you can use:
```
docker build . -t PROJECT_NAME:latest
```
This allows you to run the container as follows:
```
docker run -it --rm PROJECT_NAME:latest
```