YAML · 519 B

Docker Compose YAML

A three-service docker-compose file (web, api, db) with ports, volumes and environment variables.

CC0 · free for any use · Verified by an independent tool · Report a problem

docker-compose.yml — first linesYAML
# Sample docker-compose file
services:
  web:
    image: nginx:1.27-alpine
    ports:
      - "8080:80"
    volumes:
      - ./site:/usr/share/nginx/html:ro
    depends_on:
      - api
  api:
    build: ./api
    environment:
      DATABASE_URL: postgres://sample:sample@db:5432/sample
      LOG_LEVEL: info
    restart: unless-stopped
  db:
    image: postgres:17
    environment:
      POSTGRES_USER: sample
      POSTGRES_PASSWORD: sample
    volumes:
      - db-data:/var/lib/postgresql/data
volumes:
  db-data: {}

File details

Size
519 B (519 bytes)
MIME type
application/yaml
SHA-256
2d0c212984ff02ba86a28d5f907902c3d738b59e05aa7073cc273b72f25ea523
MD5
661af0914a8974f4b2831f9fabf509a3

Download from the command line

curl -L -o docker-compose.yml https://files.samplefiles.com/data/yaml/docker-compose.yml

Or check the download in your browser with the checksum calculator.

Similar YAML files

FileSizeDetailsDownload
YAML config filesample-config.yaml571 BDownload
YAML, 100 nested recordssample-100-records.yaml55.8 KB100 rowsDownload
1 MB YAML filesample-1mb.yaml1023 KB3,203 rowsDownload
10 MB YAML filesample-10mb.yaml9.9 MB31,832 rowsDownload