我不明白我错过了什么.
docker.compose.yml
version: "3"
services:
web:
# replace username/repo:tag with your name and image details
image: svezday/friendlyhello:part-1
deploy:
replicas: 5
restart_policy:
condition: on-failure
resources:
limits:
cpus: "0.1"
memory: 50M
ports:
- "80:80"
networks:
- webnet
visualizer:
image: dockersamples/visualizer:stable
ports:
- "8080:8080"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock"
deploy:
placement:
constraints: [node.role == manager]
networks:
- webnet
networks:
webnet:
Run Code Online (Sandbox Code Playgroud)
Dockerfile
# Use an official Python runtime as a parent image
FROM python:2.7-slim
# Set the working directory to /app
WORKDIR /app
# Copy the …Run Code Online (Sandbox Code Playgroud)