Generated Dockerfiles
For a project with no Dockerfile, Ferry writes one. Its name is Dockerfile.ferry.
Base image. A small official image of the language.
The base image and the dependencies change less often than your code. Thus Docker keeps their layers in the cache.
An example
The project examples/python-hello has a requirements.txt and a Procfile with web: python app.py. Ferry writes this file:
# Generated by Ferry: Python app.
# Commit your own Dockerfile to customize the build.
FROM python:3.12-slim
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_DISABLE_PIP_VERSION_CHECK=1 \
PIP_ROOT_USER_ACTION=ignore
WORKDIR /app
COPY requirements.txt ./
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
CMD ["/bin/sh","-c","python app.py"]Change the result
The generated file exists only during the build. To change the build, commit your own Dockerfile. Then Ferry uses your file.
Ferry writes Dockerfile.ferry in the root directory. It never replaces a file of yours. If the name exists, Ferry uses Dockerfile.ferry.1, then Dockerfile.ferry.2, and so on.
If the project has no .dockerignore, Ferry also writes one. It leaves out .git, node_modules, target, .venv, __pycache__ and the Dockerfiles that Ferry wrote.
See Node.js, Python, Go, Rust, Ruby and Static sites. For each language in practice, see Language guides.