Create Dockerfile in Backend

This commit is contained in:
hnico21 2024-09-25 19:21:14 +02:00 committed by GitHub
parent ee11f50cd2
commit afaf9ff93b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

19
backend/Dockerfile Normal file
View file

@ -0,0 +1,19 @@
# Use official Python image
FROM python:3.10-slim
# Set working directory
WORKDIR /app
# Copy backend source code
COPY . /app
# Install dependencies
RUN apt-get update && apt-get install -y gcc libpq-dev
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
# Expose backend port
EXPOSE 8000
# Run FastAPI using uvicorn
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "8000"]