-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.alpine
More file actions
49 lines (37 loc) · 1.11 KB
/
Dockerfile.alpine
File metadata and controls
49 lines (37 loc) · 1.11 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
46
47
48
49
FROM python:3.12-alpine
# Set working directory
WORKDIR /app
# Install build dependencies needed for Python packages
RUN apk add --no-cache \
gcc \
musl-dev \
libffi-dev \
openssl-dev \
cargo \
rust
# Create virtual environment using Python's built-in venv
# This isolates dependencies from the system Python
RUN python -m venv /app/.venv
# Set environment variables to use the venv
ENV PATH="/app/.venv/bin:$PATH"
ENV VIRTUAL_ENV="/app/.venv"
ENV PYTHONUNBUFFERED=1
# Copy dependency files
COPY requirements.txt .
COPY pyproject.toml .
COPY setup.py .
COPY README.md .
# Install dependencies in the virtual environment
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY chatrixcd/ ./chatrixcd/
# Install the application in the venv
RUN pip install --no-cache-dir -e .
# Remove build dependencies to reduce image size
RUN apk del gcc musl-dev libffi-dev openssl-dev cargo rust
# Create store directory
RUN mkdir -p /app/store
# Note: Configuration should be provided via mounted config.json file
# Example: -v ./config.json:/app/config.json:ro
# Run the bot
CMD ["chatrixcd"]