version: '3'
services:
  nginx:
    # https://hub.docker.com/_/nginx/
    image: 'nginx:1.15-alpine'
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/statics:/nginx
    ports:
      - '80:80'
    links:
      - client
      - server
  client:
    # https://hub.docker.com/_/node/
    build: ./client
    ports:
      - '5984:5984'
    volumes:
      - ./client:/client
    links:
      - server
  server:
    # https://hub.docker.com/_/node/
    build: ./server
    ports:
      - '8653:8653'
    volumes:
      - ./server:/server
    links:
      - postgres
  postgres:
    # https://hub.docker.com/_/postgres/
    build: ./postgres
    ports:
      - '5432:5432'
    environment:
      POSTGRES_DB: sagefy
      POSTGRES_USER: sagefy
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
      - ./postgres:/postgres

version: '3'
services:
  nginx:
    # https://hub.docker.com/_/nginx/
    image: 'nginx:1.15-alpine'
    volumes:
      - ./nginx/nginx.conf:/etc/nginx/nginx.conf
      - ./nginx/statics:/nginx
    ports:
      - '80:80'
    links:
      - client
      - server
  client:
    # https://hub.docker.com/_/node/
    build: ./client
    ports:
      - '5984:5984'
    volumes:
      - ./client:/client
    links:
      - server
  server:
    # https://hub.docker.com/_/node/
    build: ./server
    ports:
      - '8653:8653'
    volumes:
      - ./server:/server
      - ./.env:/server/.env
    links:
      - postgres
  postgres:
    # https://hub.docker.com/_/postgres/
    build: ./postgres
    ports:
      - '5432:5432'
    environment:
      POSTGRES_DB: sagefy
      POSTGRES_USER: sagefy
    volumes:
      - ./postgres-data:/var/lib/postgresql/data
      - ./postgres:/postgres
      - ./.env:/postgres/.env

Load .env in service and postgres
Load .env in service and postgres
