version: '3' services: db: image: 'postgres' container_name: 'my_postgres' env_file: - .env ports: - '5432:5432' volumes: - my_data:/var/lib/postgresql/data volumes: my_data: