Home > Enterprise >  Container uses port bindings of unknown origin
Container uses port bindings of unknown origin

Time:09-03

Dockerfile contains:

FROM node:16-alpine AS builder
WORKDIR /app

COPY package.json package-lock.json ./
RUN npm install

COPY public ./public
COPY src/ ./src
RUN npm run-script build

FROM caddy:2.2.0-alpine
WORKDIR /app

COPY --from=builder /app/build build
COPY Caddyfile .

EXPOSE 3000
CMD ["/docker-entrypoint.sh"]

docker-compose.yml says:

version: '3.7'

services:
  frontend:
    container_name: frontend
    build:
      context: .
      dockerfile: Dockerfile
    ports:
      - '3000:3000'

And after starting the container, I see some additional bindings that came from nowhere, or at least not from what I defined in configuration files:

CONTAINER ID   IMAGE                          COMMAND                  CREATED         STATUS         PORTS
                     NAMES
3eae13fc3a1b   frontend_frontend   "/docker-entrypoint.…"   5 minutes ago   Up 5 minutes   80/tcp, 443/tcp, 2019/tcp, 0.0.0.0:5000->5000/tcp, :::5000->5000/tcp
                     frontend

Where do these 80, 443 and 2019 bindings may be coming from?

CodePudding user response:

Those are exposed in the caddy Dockerfile

  • Related