farwew commited on
Commit
dda2e5b
·
verified ·
1 Parent(s): 2b17876

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +31 -30
Dockerfile CHANGED
@@ -1,31 +1,32 @@
1
- FROM python:3.9-slim
2
-
3
- WORKDIR /app
4
-
5
- # Install system dependencies
6
- RUN apt-get update && apt-get install -y \
7
- gcc \
8
- && rm -rf /var/lib/apt/lists/*
9
-
10
- # Copy requirements and install Python dependencies
11
- COPY requirements.txt .
12
- RUN pip install --no-cache-dir -r requirements.txt
13
-
14
- # Copy application files
15
- COPY main.py .
16
- COPY static/ ./static/
17
-
18
- # Create necessary directories with proper permissions
19
- RUN mkdir -p uploads
20
- RUN mkdir -p data
21
- RUN chmod 777 data # Pastikan direktori dapat ditulis
22
-
23
- # Expose port
24
- EXPOSE 7860
25
-
26
- # Set environment variables
27
- ENV PYTHONUNBUFFERED=1
28
- ENV PORT=7860
29
-
30
- # Run the application
 
31
  CMD ["python", "main.py"]
 
1
+ FROM python:3.9-slim
2
+
3
+ WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ gcc \
8
+ && rm -rf /var/lib/apt/lists/*
9
+
10
+ # Copy requirements and install Python dependencies
11
+ COPY requirements.txt .
12
+ RUN pip install --no-cache-dir -r requirements.txt
13
+
14
+ # Copy application files
15
+ COPY main.py .
16
+ COPY static/ ./static/
17
+
18
+ # Create necessary directories with proper permissions
19
+ RUN mkdir -p uploads
20
+ RUN mkdir -p data
21
+ RUN chmod 777 uploads # Add permission for uploads directory
22
+ RUN chmod 777 data # Pastikan direktori dapat ditulis
23
+
24
+ # Expose port
25
+ EXPOSE 7860
26
+
27
+ # Set environment variables
28
+ ENV PYTHONUNBUFFERED=1
29
+ ENV PORT=7860
30
+
31
+ # Run the application
32
  CMD ["python", "main.py"]