Spaces:
Sleeping
Sleeping
Upload Dockerfile
Browse files- Dockerfile +5 -1
Dockerfile
CHANGED
|
@@ -13,12 +13,16 @@ RUN apt-get update && apt-get install -y \
|
|
| 13 |
COPY requirements.txt .
|
| 14 |
|
| 15 |
# Install any needed packages specified in requirements.txt
|
| 16 |
-
# Using CPU version of torch to keep the image size smaller and compatible with free CPU spaces
|
| 17 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 18 |
|
| 19 |
# Copy the rest of the application code into the container
|
| 20 |
COPY . .
|
| 21 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 22 |
# Expose port 7860 as required by Hugging Face Spaces
|
| 23 |
EXPOSE 7860
|
| 24 |
|
|
|
|
| 13 |
COPY requirements.txt .
|
| 14 |
|
| 15 |
# Install any needed packages specified in requirements.txt
|
|
|
|
| 16 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 17 |
|
| 18 |
# Copy the rest of the application code into the container
|
| 19 |
COPY . .
|
| 20 |
|
| 21 |
+
# Hugging Face Spaces runs as user with UID 1000
|
| 22 |
+
# Grant ownership of /app so SQLite DB can be created and written
|
| 23 |
+
RUN useradd -m -u 1000 appuser && chown -R appuser:appuser /app
|
| 24 |
+
USER appuser
|
| 25 |
+
|
| 26 |
# Expose port 7860 as required by Hugging Face Spaces
|
| 27 |
EXPOSE 7860
|
| 28 |
|