A **Containerfile** is a plain-text file that contains instructions for building a container image. It is the same as a [[Dockerfile]] and is used by container engines (like [[Docker]], [[Podman]], or [[Buildah]]) to automate the process of assembling a container. The file lists a series of commands and configurations that dictate how the container image is constructed.
```Containerfile
# Use an official Python runtime as a parent image
FROM python:3.9-slim
# Set the working directory in the container
WORKDIR /app
# Copy the requirements file into the container at /app
COPY requirements.txt .
# Install any needed packages specified in requirements.txt
RUN pip install --no-cache-dir -r requirements.txt
# Copy the rest of the application's code into the container
COPY . .
# Define environment variable (optional)
ENV PYTHONUNBUFFERED=1
# Specify the command to run on container start
CMD ["python", "app.py"]
```
its basically the same as a [[Dockerfile]] but with a different (general) naming.