forked from huygiatrng/AlpacaTradingAgent
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (35 loc) · 1.14 KB
/
Copy pathDockerfile
File metadata and controls
47 lines (35 loc) · 1.14 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
# syntax=docker/dockerfile:1
# Base image
FROM python:3.11-slim
ENV PYTHONDONTWRITEBYTECODE=1 \
PYTHONUNBUFFERED=1 \
PIP_NO_CACHE_DIR=1
WORKDIR /app
# System dependencies for building some Python packages (lxml, hnswlib, etc.)
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
build-essential \
gcc \
g++ \
cmake \
libxml2-dev \
libxslt1-dev \
libffi-dev \
curl \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies first for better layer caching
COPY requirements.txt ./
RUN python -m pip install --upgrade pip \
&& pip install --no-cache-dir -r requirements.txt
# Copy project files
COPY . .
# Install the package itself (ensures setup.py install_requires are satisfied)
RUN pip install --no-cache-dir -e .
# Create non-root user
RUN adduser --disabled-password --gecos "" appuser \
&& chown -R appuser:appuser /app
USER appuser
# Expose the Dash server port
EXPOSE 7860
# Default command: bind to 0.0.0.0 for container networking
CMD ["python", "run_webui_dash.py", "--server-name", "0.0.0.0"]