Sobes.tech
Junior — Middle

Have you created Dockerfile files to automate container builds?

sobes.tech AI

Answer from AI

Yes, creating a Dockerfile is a standard practice for automating container builds. A Dockerfile is a text file with instructions that Docker uses to create an image.

Example of a simple Dockerfile for a Python application:

# Use the official Python image
FROM python:3.9-slim

# Copy application files into the container
COPY . /app
WORKDIR /app

# Install dependencies
RUN pip install -r requirements.txt

# Run the application
CMD ["python", "app.py"]

This file allows for reproducible and quick creation of containers with the required environment and application.