-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (27 loc) · 1.35 KB
/
Dockerfile
File metadata and controls
34 lines (27 loc) · 1.35 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
# Use an official Python runtime as a parent image.
# We use a slim version to keep the image size smaller.
FROM python:3.11-slim
# Set the working directory in the container to /app.
WORKDIR /app
# Install system dependencies required for psycopg2.
# libpq-dev is the PostgreSQL client library and build-essential provides
# tools for compiling C code, which psycopg2 requires during installation.
RUN apt-get update && apt-get install -y \
build-essential \
libpq-dev \
&& rm -rf /var/lib/apt/lists/*
# Copy the requirements file into the working directory.
COPY requirements.txt .
# Install the Python packages. This step will now succeed
# because the necessary system libraries are present.
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of your application's source code into the container.
# Assuming your main application file is `verifikator.py`
COPY . .
# Expose the port your Uvicorn server is running on (default is 8000).
EXPOSE 8000
# Run the command to start the application when the container launches.
# Adjust the entry point to match your application's file name and FastAPI instance.
# For example, if your app is in `verifikator.py` and the FastAPI instance is `app`,
# the command would be `uvicorn verifikator:app --host 0.0.0.0 --port 8000`.
CMD ["uvicorn", "verifikator:app", "--host", "0.0.0.0", "--port", "8000"]