-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathDockerfile
More file actions
43 lines (34 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
43 lines (34 loc) · 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
43
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Set environment variables
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
# Install system dependencies in a single RUN command to leverage caching
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
gcc \
libffi-dev \
libssl-dev \
libexpat1 \
libgdal-dev \
libproj-dev \
libspatialindex-dev && \
rm -rf /var/lib/apt/lists/*
# Set the working directory
WORKDIR /app
# Copy only requirements to leverage Docker cache
COPY requirements.txt .
# Install Python dependencies
RUN pip install --upgrade pip && \
pip install -r requirements.txt
# Install additional Python packages
RUN pip install redis "uvicorn[standard]"
# Copy the rest of the application code
COPY . .
# Create the local_uploads directory and set permissions
RUN mkdir -p local_uploads && chmod 777 local_uploads
# Expose the necessary port
EXPOSE 8001
# Define the default command
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8001", "--reload"]