Start nodejs app inside of traefik container

Hi all,

I want to start a nodejs app inside of a traefik container with following setup:

Dockerfile for my t14 image:

#FROM traefik:v3.0
FROM traefik:v3.0

ENV NODE_ENV=production

# install apk
RUN apk update && apk --no-cache add curl && apk --no-cache add bash

# install node
RUN apk add --update nodejs npm
RUN node --version
RUN npm --version
# end

COPY ./app /app

CMD npm start


version: '3'

    image: t14
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "; bash -c 'npm start'"
      - 80:80
      - 443:443
      # The Web UI (enabled by --api.insecure=true)
      - 8080:8080
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.yml:/etc/traefik/traefik.yml
      - ./ssl-certs:/ssl-certs
      - traefik_web

But ive the problem that "bash -c 'npm start'" never gets executed. In other words my nodejs app never starts... Any hints / help regarding my problem?

Best regards

The idea of containers is isolation, so not to have applications with different dependencies in the same space.

As far as I know there is not even bash installed in the Traefik container. The Traefik container is highly customized for Traefik, not for other apps.

Furthermore you assume that Traefik terminates, so the second command is run afterwards. I would assume Traefik runs forever to enable output to stdout and stderr.

Check the container output for more info on what is happening.

Maybe you share what you want to achieve.