SaturnCI jobs run in environments. If you know how to define a Docker Compose environment, you know how to define a SaturnCI environment.
Environments live in .saturnci/environments/<environment
name>/. To create an environment called, for example,
ruby, put a Dockerfile and a
docker-compose.yml in
.saturnci/environments/ruby. Below is an example of just
such an environment.
# .saturnci/environments/ruby/Dockerfile
FROM ruby:4.0.1-slim
RUN apt-get update && apt-get install -y \
git \
&& rm -rf /var/lib/apt/lists/*
# .saturnci/environments/ruby/docker-compose.yml
services:
job:
build:
context: ../../..
dockerfile: .saturnci/environments/ruby/Dockerfile
volumes:
- ../../../:/app
working_dir: /app