leonsimon23 commited on
Commit
214ac03
·
verified ·
1 Parent(s): 8ab047f

Create dockerfile_bak

Browse files
Files changed (1) hide show
  1. dockerfile_bak +30 -0
dockerfile_bak ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # syntax=docker/dockerfile:1.4
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Install necessary dependencies
8
+ RUN apt-get update && apt-get install -y git
9
+
10
+ # Upgrade pip to the latest version
11
+ RUN pip install --upgrade pip
12
+
13
+ # Create necessary directories and set permissions
14
+ RUN mkdir -p /app && chmod -R 777 /app
15
+
16
+ # Clone private repository using mounted secret
17
+ RUN --mount=type=secret,id=GITHUB_TOKEN,mode=0444,required=true \
18
+ git clone https://x-access-token:$(cat /run/secrets/GITHUB_TOKEN)@github.com/leoncool23/pdpredict.git .
19
+
20
+ # Copy the static directory into the container
21
+ COPY static /app/static
22
+
23
+ # Install Python dependencies
24
+ RUN pip install --no-cache-dir -r requirements.txt
25
+
26
+ # Expose the port for FastAPI
27
+ EXPOSE 7860
28
+
29
+ # Run the FastAPI app with uvicorn
30
+ CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]