diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..e935792 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,13 @@ +# Exclude Python cache and virtual environments +__pycache__/ +*.pyc + +# Exclude git +.git + +# Exclude IDE/editor config +*.vscode +*.idea + +# Exclude documentation files +*.md \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..ed2f0b5 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +# Use the official Python base image +FROM python:3.11-slim + +# Set the working directory in the container +WORKDIR /app + +# Copy only the requirements file to leverage Docker cache +COPY src/requirements.txt ./ + +# Install the dependencies +RUN pip install --no-cache-dir -r requirements.txt + +# Copy the entire app directory into the container +COPY src/app ./app + +# Expose the port FastAPI will use +EXPOSE 8080 + +# Correct Command to run when the container starts +CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8080"] \ No newline at end of file