-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
36 lines (27 loc) · 926 Bytes
/
Dockerfile
File metadata and controls
36 lines (27 loc) · 926 Bytes
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
# Use the official Python image as the base image
FROM python:3.11-slim
# Set environment variables
ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
# Set the working directory in the container
WORKDIR /app-docker
# Install required system packages
# Install necessary build tools and compilers
# RUN apt-get update && apt-get install -y \
# build-essential \
# gcc \
# g++ \
# make \
# libmagic-dev \
# && rm -rf /var/lib/apt/lists/*
# RUN g++ --version
# Copy the requirements file to the container
COPY requirements.txt .
# Install the required dependencies
RUN pip install --upgrade pip && pip install --no-cache-dir -r requirements.txt
# Copy the entire FastAPI app code into the container
COPY . .
# Expose the port that FastAPI and Dash will run on
EXPOSE 8000
# Run the FastAPI app with Uvicorn
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000" , "--reload"]