You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
swarms/Dockerfile

43 lines
1.2 KiB

6 days ago
# Use an official Python runtime as a parent image
FROM python:3.11-slim-bullseye
6 days ago
# Set environment variables for Python behavior
2 weeks ago
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
2 weeks ago
PIP_NO_CACHE_DIR=1 \
6 days ago
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_DEFAULT_TIMEOUT=100
2 weeks ago
# Set the working directory
6 days ago
WORKDIR /usr/src/app
2 weeks ago
6 days ago
# Copy the entire project into the container
COPY . .
2 weeks ago
6 days ago
# Install system dependencies and clean up
6 days ago
RUN apt-get update && \
apt-get install -y --no-install-recommends \
git \
&& rm -rf /var/lib/apt/lists/*
2 weeks ago
6 days ago
# Install Poetry and pytest
6 days ago
RUN pip install --no-cache-dir poetry pytest
2 weeks ago
6 days ago
# Configure Poetry and install project dependencies
6 days ago
RUN poetry config virtualenvs.create false && \
poetry install --no-interaction --no-ansi
2 weeks ago
6 days ago
# Create logs directory with proper permissions
RUN mkdir -p /usr/src/app/logs && chmod -R 777 /usr/src/app/logs
2 weeks ago
6 days ago
# Add pytest to PATH and verify installation
ENV PATH="/usr/local/bin:/root/.local/bin:$PATH"
6 days ago
# Verify pytest installation
6 days ago
RUN python -m pytest --version
6 days ago
# Set the ENTRYPOINT to use pytest
ENTRYPOINT ["python", "-m", "pytest"]
# Set default command arguments
CMD ["--continue-on-collection-errors", "--tb=short", "--disable-warnings"]