Docker Community Forums

Share and learn in the Docker community.

Restart with Docker compose file

docker

#1

Hi All,

I have written a docker-compose file (below) and want to restart the container whenever It stop. File run successfully and both container starts but when I stop one container (Drupal) then it won’t start automatically, Could you please help me out to find what I am doing wrong.

version: ‘3’

services:
drupal:
image: drupal
ports:
- “8080:80”
restart: always
postgres:
image: postgres
environment:
- POSTGRES_PASSWORD=mypassword

Thanks
Gaurav


(Fsejoseph) #2

Read this