[81a4e3]: / Dockerfile

Download this file

43 lines (35 with data), 1.1 kB

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#FROM python:3.9-slim
#
## Set working directory
#WORKDIR /app
#
## Install gcc and other build dependencies
#RUN apt-get update && apt-get install -y gcc build-essential
#
## Copy requirements.txt
#COPY requirements.txt .
#
## Install dependencies
#RUN pip install --no-cache-dir -r requirements.txt
#
## Copy the rest of the application code
#COPY . .
#
## Expose port (if using FastAPI or any web server)
#EXPOSE 8000
#
## Command to run your app (replace this with your actual command, e.g., uvicorn for FastAPI)
#CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8000"]
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.txt
# Make port 8000 available to the world outside this container
EXPOSE 8000
# Run FastAPI server
CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "8000"]