Docker-Compose run NodeJS and Python3 in different containers

Viewed 249

I tried to run in one container NodeJS and in other container Python3. I have two node applications and one python aplication.

Dockerfile

WORKDIR /app
COPY package.json /app
RUN npm install
RUN apt-get update || : && apt-get install python -y
COPY . /app
CMD ["npm", "start"] 

Docker-Compose

services:
  app1:
    build: .
    ports:
      - 3100:3100
    command: node ./app.js
  app2:
    build: .
    ports:
      - 3000:3000
    command: node ./app1.js
  app3:
    build: .
    command: python ./algo.py

Is it possible to run all of these apps in one image with docker-compose

0 Answers
Related