Here is docker-compose.yml file:
version: '3.8'
services:
dev-db:
image: postgres:13
ports:
- 5434:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: nest
networks:
- freecodecamp
networks:
freecodecamp
CodePudding user response:
The last networks
definition needs to be pulled out a level, so it lines up with services
, like this
version: '3.8'
services:
dev-db:
image: postgres:13
ports:
- 5434:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: 123
POSTGRES_DB: nest
networks:
- freecodecamp
networks:
freecodecamp:
Like Turing85 says, it also needs a colon after the network name.