often.cloud
source
Theme
← all tools
docker run → compose
Web
Translate a `docker run …` command into a docker-compose service block.
docker run command
docker run -d --name web -p 8080:80 -v ./html:/usr/share/nginx/html -e NGINX_HOST=example.com --restart unless-stopped nginx:alpine
docker-compose.yml
Copy
# docker-compose.yml services: web: ports: - 8080:80 volumes: - ./html:/usr/share/nginx/html environment: NGINX_HOST: example.com restart: unless-stopped image: nginx:alpine