matimh.eu

Docker Run to Compose

docker run commands - one or more

2 commands found · -p, -e, -v, --name, --restart, --network and --health-cmd are converted

compose.yaml

services:
  db:
    image: postgres:17-alpine
    restart: unless-stopped
    ports:
      - 5432:5432
    environment:
      POSTGRES_PASSWORD: change-me
    volumes:
      - pgdata:/var/lib/postgresql/data
  web:
    image: nginx:alpine
    ports:
      - 8080:80
    volumes:
      - ./site:/usr/share/nginx/html:ro
volumes:
  pgdata: