Skip to main content

docker expose

Docker Container ohne Ports betreiben.

Netwerk einrichten damit die Zuweisung mit IP-Adressen funktioniert:

docker network create \
  --driver=bridge \
  --subnet=172.26.0.0/24 \
  my_bridge_network

Einrichtung Portainer: 

services:
  portainer-ce:
    container_name: portainer
    restart: always
    volumes:
      - '/var/run/docker.sock:/var/run/docker.sock'
      - 'portainer_data:/data'
    image: 'portainer/portainer-ce:latest'
    networks:
      my_bridge_network:
        ipv4_address: 172.26.0.4

volumes:
  portainer_data:

networks:
  my_bridge_network:
    external: true

Einrichtung Apache2:

services:
  apache:
    image: httpd:latest
    container_name: apache2
    volumes:
      - ./app:/usr/local/apache2/htdocs

    networks:
      my_bridge_network:
        ipv4_address: 172.26.0.3

volumes:
  open-webui:

networks:
  my_bridge_network:
    external: true

Einrichtung Zoraxy:

services:
  zoraxy:
    image: zoraxydocker/zoraxy:latest
    container_name: zoraxy
    restart: unless-stopped
    ports:
      - 80:80
      - 443:443
    expose:
      - 8000:8000
    volumes:
      - /home/joachim/docker/zoraxy/config/:/opt/zoraxy/config/
      - /home/joachim/docker/zerotier/config/:/var/lib/zerotier-one/
      - /var/run/docker.sock:/var/run/docker.sock
      - /etc/localtime:/etc/localtime
    environment:
      FASTGEOIP: "true"
      ZEROTIER: "true"

    networks:
      my_bridge_network:
        ipv4_address: 172.26.0.2

networks:
  my_bridge_network:
    external: true