Spaces:
Running
Running
Update Dockerfile
Browse files- Dockerfile +15 -16
Dockerfile
CHANGED
@@ -1,25 +1,24 @@
|
|
1 |
-
# Use
|
2 |
-
FROM python:3.
|
3 |
|
4 |
-
#
|
5 |
-
|
|
|
|
|
|
|
|
|
6 |
|
7 |
-
#
|
8 |
-
|
9 |
-
openjdk-11-jre \
|
10 |
-
&& rm -rf /var/lib/apt/lists/*
|
11 |
|
12 |
-
# Copy
|
13 |
-
COPY
|
14 |
|
15 |
# Install Python dependencies
|
16 |
RUN pip install --no-cache-dir -r requirements.txt
|
17 |
|
18 |
-
#
|
19 |
-
COPY . .
|
20 |
-
|
21 |
-
# Expose the port the app runs on (Hugging Face Spaces default is 7860)
|
22 |
EXPOSE 7860
|
23 |
|
24 |
-
|
25 |
-
CMD ["
|
|
|
1 |
+
# Use the official Python 3.10 image as a base
|
2 |
+
FROM python:3.10-slim
|
3 |
|
4 |
+
# Install OpenJDK 11 (includes javac)
|
5 |
+
RUN apt-get update && apt-get install -y openjdk-11-jdk && apt-get clean
|
6 |
+
|
7 |
+
# Set JAVA_HOME environment variable
|
8 |
+
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
|
9 |
+
ENV PATH=$JAVA_HOME/bin:$PATH
|
10 |
|
11 |
+
# Set working directory
|
12 |
+
WORKDIR /home/user/app
|
|
|
|
|
13 |
|
14 |
+
# Copy your app files
|
15 |
+
COPY . .
|
16 |
|
17 |
# Install Python dependencies
|
18 |
RUN pip install --no-cache-dir -r requirements.txt
|
19 |
|
20 |
+
# Expose the port HF Spaces uses
|
|
|
|
|
|
|
21 |
EXPOSE 7860
|
22 |
|
23 |
+
# Run the Flask app
|
24 |
+
CMD ["python", "app.py"]
|