Answer the question
In order to leave comments, you need to log in
Why can't I run node js along with nginx on docker-compose?
Hello everyone, tell me what the error is, I'm trying to set up a project on express.js, I'm trying to deploy on docker'e, I can't connect nginx, an error occurs that the port is busy, how can I fix it?
version: '3.8'
services:
backend:
container_name: my-server
image: my-server:0.2
build:
context: .
ports:
- "80:5001"
environment:
- EXTERNAL_PORT=5001
depends_on:
- node_db
node_db:
container_name: my_db
image: "postgres:13.5"
ports:
- "5432:5432"
volumes:
- nps_data:/var/lib/postgresql/data
environment:
- DB_NAME=name
- DB_USER=admin
- DB_PASSWORD=password
- DB_HOST=my_db
- DB_PORT=5432
- POSTGRES_PASSWORD=mysecretpassword
nginx:
image: nginx:1.19
volumes:
- .\nginx:/etc/nginx/conf.d
ports:
- 80:80
- 443:443
env_file:
- .env
depends_on:
- backend
volumes:
nps_data: {}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question