-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
executable file
·45 lines (35 loc) · 1.25 KB
/
Dockerfile
File metadata and controls
executable file
·45 lines (35 loc) · 1.25 KB
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 official Python image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1 \
POETRY_VERSION=1.7.1 \
POETRY_HOME="/opt/poetry" \
VENV_PATH="/opt/venv"
# Install system dependencies
RUN apt-get update && apt-get install -y --no-install-recommends \
curl \
git \
&& rm -rf /var/lib/apt/lists/*
# Install Poetry
RUN curl -sSL https://install.python-poetry.org | python3 - --version ${POETRY_VERSION}
ENV PATH="${POETRY_HOME}/bin:${PATH}"
# Create a virtual environment
RUN python -m venv ${VENV_PATH}
ENV PATH="${VENV_PATH}/bin:${PATH}"
# Set working directory
WORKDIR /app
# Copy only necessary files for installation
COPY pyproject.toml poetry.lock README.md ./
COPY src/domd/ ./src/domd/
# Install the package in development mode with all dependencies
RUN poetry config virtualenvs.create false \
&& poetry install --no-interaction --no-ansi \
&& cd /app && pip install -e .
# Verify installation
RUN python -c "import domd; print(f'Successfully installed domd version: {domd.__version__}'); print(f'Python path: {domd.__file__}')"
# Set the entrypoint to run domd
ENTRYPOINT ["domd"]
# Default command to show help if no command is provided
CMD ["--help"]