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
# 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
Download from the command line
curl -L -o docker-compose.yml https://files.samplefiles.com/data/yaml/docker-compose.ymlwget https://files.samplefiles.com/data/yaml/docker-compose.ymlhttps://files.samplefiles.com/data/yaml/docker-compose.ymlprintf '%s %s\n' 2d0c212984ff02ba86a28d5f907902c3d738b59e05aa7073cc273b72f25ea523 docker-compose.yml | shasum -a 256 -cOr check the download in your browser with the checksum calculator.
Similar YAML files
| File | Size | Details | Download |
|---|---|---|---|
| YAML config filesample-config.yaml | 571 B | Download | |
| YAML, 100 nested recordssample-100-records.yaml | 55.8 KB | 100 rows | Download |
| 1 MB YAML filesample-1mb.yaml | 1023 KB | 3,203 rows | Download |
| 10 MB YAML filesample-10mb.yaml | 9.9 MB | 31,832 rows | Download |