Webpack Dev Server not being forwarded

Hi,

I have a remote server that I plan to use as a remote development environment for Ionic Framework projects. I plan to run ionic serve from within a container and preview them based on a specific URL.

Basically, I will run a container having all runtimes required to develop an Ionic project and docker exec into the container to generate and serve my ionic project.

As of now, whenever I run ionic serve, I can successfully see my ionic serve working by curling to the internal docker IP (172.17.0.2). However, when I try to curl -H Host:code.mydomain.tld http://myserver.mydomain.tld, I can't make it work.

My Traefik config (docker-compose.yml):

version: '3.7'

services:
  reverse_proxy:
    image: traefik:v2.0
    command: --api.insecure=true --providers.docker --log.level="DEBUG" --accesslog=true --api.dashboard=true
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock

My Ionic Framework image (Dockerfile):

FROM ubuntu:latest

RUN apt-get update
RUN apt-get install -y openssh-server curl vim net-tools iptables
RUN mkdir /var/run/sshd
RUN echo 'root:root' | chpasswd
RUN sed -ri 's/^#?PermitRootLogin\s+.*/PermitRootLogin yes/' /etc/ssh/sshd_config
RUN sed -ri 's/UsePAM yes/#UsePAM yes/g' /etc/ssh/sshd_config
RUN mkdir /root/.ssh

RUN whoami
RUN pwd

RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g ionic

RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

EXPOSE 8100

CMD ["/usr/sbin/sshd", "-D"]

My Ionic Framework run command:

docker run --detach \
  --name "code01" \
  --label "traefik.enable=true" \
  --label "traefik.http.routers.ionic-preview.rule=Host(\`code.mydomain.tld\`)" \
  --label "traefik.http.routers.ionic-preview.entrypoints=http" \
  --label "traefik.http.routers.ionic-preview.service=ionic-preview-svc" \
  --label "traefik.http.services.ionic-preview-svc.loadbalancer.server.port=8100" \
  biborn/ionic:latest

Any help would be much appreciated.

Note: This is for development purpose only.

Hi @biborn,
I know this issue is really old, but did you solve the problem? I am trying to do something like this and it is also not working :grimacing:

Thanks