If I build from the Dockerfile I can run the docker run IMAGE_ID /bin/bash and browse the container.
But if I run docker-compose up -d from docker-compose.yml and run docker attach, it doesn't respond, it stays still in the container terminal and sometimes leaves the container terminal alone
Follow my docker files
Dockerfile
FROM nginx:1.21.6
EXPOSE 80
WORKDIR /etc/nginx
ENTRYPOINT /bin/bash
docker-compose.yml
version: "3.8"
services:
reverse:
build:
dockerfile: Dockerfile
context: ./nginx/docker
image: reverse/nginx
container_name: reverse
ports:
- 80:80
- 443:443
volumes:
- ./nginx:/etc/nginx
tty: true
ENTRYPOINTfornginximage? Rundocker ps -ato see if it's running or exited. Also changebuild:tobuild: .and add adotafter that.docker-compose run serviceinstead ofdocker-compose up.docker-compose updoesn't work for me even though I specifiedstdin_open: true. See here: stackoverflow.com/a/36265910/11964524