-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.backend
More file actions
46 lines (35 loc) · 1.08 KB
/
Dockerfile.backend
File metadata and controls
46 lines (35 loc) · 1.08 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
44
45
46
# Dockerfile.backend
# Use Ubuntu 22.04 as the base image
FROM ubuntu:22.04
# Prevent interactive prompts during package installations
ENV DEBIAN_FRONTEND=noninteractive
# Update and install system dependencies
RUN apt-get update && apt-get install -y \
python3.11 \
python3.11-venv \
python3.11-dev \
build-essential \
libmupdf-dev \
curl \
libgl1 \
libglib2.0-0 \
postgresql-client \
tzdata \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
# Install pip for Python 3.11
RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.11
# Set the working directory
WORKDIR /app
# Copy requirements.txt and install Python dependencies
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Copy the rest of the application code
COPY . .
# Copy the SQL initialization script
COPY init.sql /docker-entrypoint-initdb.d/init.sql
# Expose port 8000 for FastAPI
EXPOSE 8000
# Command to run the FastAPI application using uvicorn
CMD ["uvicorn", "backend:app", "--host", "0.0.0.0", "--port", "8000", "--reload"]