Spaces:
Paused
Paused
feat: optimize Dockerfile for HuggingFace Spaces deployment
Browse files- Dockerfile +7 -3
- docker/entrypoint.sh +0 -3
Dockerfile
CHANGED
|
@@ -116,13 +116,17 @@ RUN pip install --no-cache-dir \
|
|
| 116 |
FROM base
|
| 117 |
|
| 118 |
# Create non-root user and storage directory
|
| 119 |
-
RUN
|
|
|
|
| 120 |
mkdir -p /storage/files /storage/cache /storage/logs && \
|
| 121 |
-
chown -R user:user /storage
|
|
|
|
|
|
|
| 122 |
|
| 123 |
# Install runtime dependencies
|
| 124 |
RUN apt-get install -y --no-install-recommends \
|
| 125 |
-
nodejs npm libgmp-dev libmpfr-dev libmpc-dev libssl-dev
|
|
|
|
| 126 |
pip install --no-cache-dir \
|
| 127 |
gunicorn \
|
| 128 |
gevent \
|
|
|
|
| 116 |
FROM base
|
| 117 |
|
| 118 |
# Create non-root user and storage directory
|
| 119 |
+
RUN apt-get update && \
|
| 120 |
+
useradd -m -u 1000 user && \
|
| 121 |
mkdir -p /storage/files /storage/cache /storage/logs && \
|
| 122 |
+
chown -R user:user /storage && \
|
| 123 |
+
mkdir -p /app/api && \
|
| 124 |
+
chown -R user:user /app
|
| 125 |
|
| 126 |
# Install runtime dependencies
|
| 127 |
RUN apt-get install -y --no-install-recommends \
|
| 128 |
+
nodejs npm libgmp-dev libmpfr-dev libmpc-dev libssl-dev \
|
| 129 |
+
postgresql-client redis-tools && \
|
| 130 |
pip install --no-cache-dir \
|
| 131 |
gunicorn \
|
| 132 |
gevent \
|
docker/entrypoint.sh
CHANGED
|
@@ -3,9 +3,6 @@ set -e
|
|
| 3 |
|
| 4 |
echo "Starting Dify services..."
|
| 5 |
|
| 6 |
-
# Install required database clients
|
| 7 |
-
apt-get update && apt-get install -y postgresql-client redis-tools
|
| 8 |
-
|
| 9 |
# Set database connection variables from environment
|
| 10 |
export PGHOST="${DB_HOST:-db}"
|
| 11 |
export PGPORT="${DB_PORT:-5432}"
|
|
|
|
| 3 |
|
| 4 |
echo "Starting Dify services..."
|
| 5 |
|
|
|
|
|
|
|
|
|
|
| 6 |
# Set database connection variables from environment
|
| 7 |
export PGHOST="${DB_HOST:-db}"
|
| 8 |
export PGPORT="${DB_PORT:-5432}"
|