Complete the Docker Compose service to add a sidecar container that logs data.
services:
app:
image: myapp:latest
sidecar:
image: [1]The sidecar container uses the fluentd image to collect and forward logs.
Complete the Docker Compose snippet to share a volume between app and sidecar containers.
services:
app:
volumes:
- [1]:/data
sidecar:
volumes:
- shared-data:/data
volumes:
shared-data:volumes:.The volume shared-data is declared and shared between both containers at /data.
Fix the error in the Docker Compose sidecar service to correctly depend on the app service.
services:
sidecar:
image: fluentd
depends_on:
- [1]The sidecar container should depend on the app service to start after it.
Fill both blanks to configure environment variables for the sidecar container.
services:
sidecar:
image: fluentd
environment:
- [1]=info
- [2]=/var/log/app.logThe environment variables LOG_LEVEL and LOG_PATH configure logging level and log file path.
Fill all three blanks to complete the Docker Compose sidecar service with restart policy and network.
services:
sidecar:
image: fluentd
restart: [1]
networks:
- [2]
depends_on:
- [3]
networks:
appnet:The sidecar restarts always, uses the appnet network, and depends on the app service.