0

I have a basic docker-compose.yml:

version: '2'
services:
  hvac_backend:
    build: ./HVAC_backend
    ports:
      - 8000:5000
  hvac_frontend:
    build: ./HVAC_frontend
    ports:
      - 80:80

and the two following Dockerfiles being HVAC_frontend:

FROM nginx:1.17.8

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

and HVAC_backend:

FROM balenalib/beaglebone-black-alpine-python:3-3.11

MAINTAINER Muller

WORKDIR /usr/src/app

COPY . ./

RUN pip install -r requirements.txt

ENTRYPOINT ["python"]

CMD ["app.py"]

When I run a normal docker build and docker run on the the HVAC_frontend nginx runs fine on localhost:80. When I do a docker-compose up -d I get a output of:

Creating hvac_balenaos_hvac_backend_1  ... done
Creating hvac_balenaos_hvac_frontend_1 ... done

but after a docker ps only the HVAC_backend is running

CONTAINER ID        IMAGE                        COMMAND             CREATED             STATUS              PORTS                    NAMES
249be0be515a        hvac_balenaos_hvac_backend   "python app.py"     10 seconds ago      Up 9 seconds        0.0.0.0:8000->5000/tcp   hvac_balenaos_hvac_backend_1

Any clues? Feels like I'm just missing something small. What happened to HVAC_frontend?

Müller
  • 313
  • 5
  • 18

1 Answers1

1

Probably your backend container starts properly but stops because of some exception.

run this command:

docker ps -a

to list all containers even this which are stopped.

enter image description here

Michał Jarzyna
  • 1,836
  • 18
  • 26
  • Thanks, this helped. I have a ```hvac_frontend_1 | standard_init_linux.go:211: exec user process caused "no such file or directory"``` – Müller Feb 19 '20 at 07:40
  • Here you have also helpful instruction on how to go inside the container from the command line: https://stackoverflow.com/a/30173220/2275775 – Michał Jarzyna Feb 19 '20 at 07:41