File size: 1,025 Bytes
50b221e
 
 
aacc9c6
 
 
1780adf
aacc9c6
 
f1c805b
 
 
 
 
d0ee289
76b9ac3
f1c805b
4a9640b
50b221e
 
 
 
aacc9c6
50b221e
 
 
 
 
 
 
 
 
 
 
9ee0def
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
# Use an official Python runtime as a parent image
FROM python:3.9-slim

# Install system dependencies
RUN apt-get update && apt-get install -y \
    libgl1 \
    libglib2.0-0 \
    && rm -rf /var/lib/apt/lists/*


# Create the configuration directory
RUN mkdir -p /deforestation_percentage_image_api/.config/sentinelhub

# Change ownership of the configuration directory
# RUN chown -R arsh1101:arsh1101 /deforestation_percentage_image_api/.config  # Ensure the user has ownership of the config directory



# Set the working directory in the container
WORKDIR /deforestation_percentage_image_api

# Copy the requirements.txt into the container
COPY requirements.txt ./requirements.txt

# Install any dependencies
RUN pip install --no-cache-dir -r requirements.txt

# Copy the current directory contents into the container
COPY . .

# Expose the port FastAPI runs on
EXPOSE 8000

# Command to run the FastAPI app using Uvicorn
CMD ["uvicorn", "deforestation_percenatge_image_api:app", "--host", "0.0.0.0", "--port", "8000"]