AIMaster7 commited on
Commit
49745a4
·
verified ·
1 Parent(s): fa60e71

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use an official Python runtime as a parent image
2
+ FROM python:3.10-slim
3
+
4
+ # Set the working directory in the container
5
+ WORKDIR /app
6
+
7
+ # Copy the requirements file into the container at /app
8
+ COPY requirements.txt .
9
+
10
+ # Install any needed packages specified in requirements.txt
11
+ # --no-cache-dir: Disables the cache to reduce image size
12
+ # -r requirements.txt: Installs packages from the given requirements file
13
+ RUN pip install --no-cache-dir -r requirements.txt
14
+
15
+ # Copy the main application file into the container at /app
16
+ COPY main.py .
17
+
18
+ # Make port 8000 available to the world outside this container
19
+ EXPOSE 8000
20
+
21
+ # Define the command to run the application
22
+ # uvicorn main:app starts the server
23
+ # --host 0.0.0.0 makes it accessible from outside the container
24
+ # --port 8000 specifies the port to run on
25
+ CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]