Spaces:
Paused
Paused
Update Dockerfile
Browse files- Dockerfile +31 -19
Dockerfile
CHANGED
@@ -1,27 +1,39 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
|
|
|
|
|
|
|
4 |
|
5 |
-
# Create
|
6 |
-
RUN mkdir -p /
|
7 |
-
RUN ln -s /data/storage /storage
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
|
12 |
-
#
|
13 |
-
|
14 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
15 |
|
16 |
-
# Copy
|
17 |
-
COPY
|
18 |
|
19 |
-
# Ensure the script has execution permissions
|
20 |
-
|
21 |
-
RUN chmod +x /usr/local/bin/copy-storage.sh
|
22 |
|
23 |
-
#
|
24 |
-
|
25 |
|
26 |
-
# Set the
|
27 |
-
ENTRYPOINT ["/
|
|
|
1 |
+
# Use the official Python image as the base
|
2 |
+
FROM python:3.11-slim
|
3 |
|
4 |
+
# Set environment variables
|
5 |
+
ENV STORAGE_DIR="/app/server/storage"
|
6 |
+
ENV SERVER_PORT=7860
|
7 |
+
ENV SQLITE_DATABASE="/app/database/your_database.db"
|
8 |
|
9 |
+
# Create necessary directories
|
10 |
+
RUN mkdir -p $STORAGE_DIR /app/database
|
|
|
11 |
|
12 |
+
# Set the working directory
|
13 |
+
WORKDIR /app
|
14 |
|
15 |
+
# Install system dependencies
|
16 |
+
RUN apt-get update && \
|
17 |
+
apt-get install -y --no-install-recommends \
|
18 |
+
build-essential \
|
19 |
+
libsqlite3-dev \
|
20 |
+
&& rm -rf /var/lib/apt/lists/*
|
21 |
+
|
22 |
+
# Install Python dependencies
|
23 |
+
COPY requirements.txt .
|
24 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
25 |
+
|
26 |
+
# Install sqlite-web
|
27 |
+
RUN pip install sqlite-web
|
28 |
|
29 |
+
# Copy application code
|
30 |
+
COPY . .
|
31 |
|
32 |
+
# Ensure the entrypoint script has execution permissions
|
33 |
+
RUN chmod +x /app/entrypoint.sh
|
|
|
34 |
|
35 |
+
# Expose necessary ports
|
36 |
+
EXPOSE $SERVER_PORT 8080
|
37 |
|
38 |
+
# Set the entrypoint
|
39 |
+
ENTRYPOINT ["/app/entrypoint.sh"]
|