CyborgBeta
Captain
- Registriert
- Jan. 2021
- Beiträge
- 3.318
Hallo, vielleicht hat hier jemand eine Idee, mich hat das schon die halbe Nacht gekostet ...
Ich nutze traefik mit einer docker-compose.yml mit Services, und möchte darin discourse starten.
Aus der
Aus dem
Aus der
So weit, so gut. Ich kann das Teil starten mit
app öffnet intern zwei Ports, einmal 3000 für discourse und einmal 80 für nginx (an der Stelle verstehe ich nicht, wieso noch einmal ein zweiter reverse proxy neben traefik benötigt wird ...):
Allerdings komme ich über curl nicht an den container heran:
Es muss doch möglich sein, an die IP bzw. den Namen eines anderen Services zu gelangen, ohne dass diese vorher bekannt ist? Ich habe bestimmt irgendetwas Einfaches (beim Hostname oder so) übersehen.
... Da mein Setup von der Standardinstallation abweicht, ist https://meta.discourse.org/t/instal...ing-recommended-supported-installation/300191 hier nur bedingt anwendbar.
Ich nutze traefik mit einer docker-compose.yml mit Services, und möchte darin discourse starten.
Aus der
docker-compose.yml
:
Code:
forum:
build: ./forum
#privileged: true # for child container
stop_signal: SIGINT
volumes:
- /var/run/docker.sock:/var/run/docker.sock # for sibling container
- ./forum/discourse/:/var/discourse/
labels:
- "traefik.enable=true"
- "traefik.http.routers.forum.rule=Host(`forum.irgendetwas.com`)"
- "traefik.http.services.forum.loadbalancer.servers.url=http://app:80"
- "traefik.http.routers.forum.entrypoints=websecure"
- "traefik.http.routers.forum.tls.certresolver=myresolver"
Aus dem
forum/Dockerfile
:
Code:
FROM debian:12
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN apt update
RUN apt upgrade -y
RUN apt install git docker.io net-tools -y
#RUN /var/discourse/launcher rebuild app
CMD [ "sh", "-c", "/var/discourse/launcher rebuild app \
&& trap '/var/discourse/launcher stop app; exit' INT; echo waiting; while : ; do sleep 1 ; done" ]
Aus der
forum/discourse/containers/app.yml
:
Code:
## this is the all-in-one, standalone Discourse Docker container template
##
## After making changes to this file, you MUST rebuild
## /var/discourse/launcher rebuild app
##
## BE *VERY* CAREFUL WHEN EDITING!
## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT!
## visit http://www.yamllint.com/ to validate this file as needed
templates:
- "templates/postgres.template.yml"
- "templates/redis.template.yml"
- "templates/web.template.yml"
## Uncomment the next line to enable the IPv6 listener
#- "templates/web.ipv6.template.yml"
- "templates/web.ratelimited.template.yml"
## Uncomment these two lines if you wish to add Lets Encrypt (https)
#- "templates/web.ssl.template.yml"
#- "templates/web.letsencrypt.ssl.template.yml"
#- "templates/web.socketed.template.yml"
## which TCP/IP ports should this container expose?
## If you want Discourse to share a port with another webserver like Apache or nginx,
## see https://meta.discourse.org/t/17247 for details
#expose:
# - "80:80" # http
# - "443:443" # https
params:
db_default_text_search_config: "pg_catalog.english"
## Set db_shared_buffers to a max of 25% of the total memory.
## will be set automatically by bootstrap based on detected RAM, or you can override
#db_shared_buffers: "256MB"
## can improve sorting performance, but adds memory usage per-connection
#db_work_mem: "40MB"
## Which Git revision should this container use? (default: tests-passed)
#version: tests-passed
env:
LC_ALL: en_US.UTF-8
LANG: en_US.UTF-8
LANGUAGE: en_US.UTF-8
# DISCOURSE_DEFAULT_LOCALE: en
# FORCE SSL
DISCOURSE_FORCE_HTTPS: true
## How many concurrent web requests are supported? Depends on memory and CPU cores.
## will be set automatically by bootstrap based on detected CPUs, or you can override
#UNICORN_WORKERS: 3
## TODO: The domain name this Discourse instance will respond to
## Required. Discourse will not work with a bare IP number.
DISCOURSE_HOSTNAME: forum.irgendetwas.com
## Uncomment if you want the container to be started with the same
## hostname (-h option) as specified above (default "$hostname-$config")
#DOCKER_USE_HOSTNAME: true
So weit, so gut. Ich kann das Teil starten mit
docker compose up -d
. Daraufhin wird dann discourse gebaut (ca. 2 Minuten), und es wird ein sibling container names app gestartet:
Code:
docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
ebd29111340c local_discourse/app "/sbin/boot" 28 minutes ago Up 28 minutes app
07983cdec0e3 proxy-forum "sh -c '/var/discour…" 35 minutes ago Up 35 minutes proxy-forum-1
app öffnet intern zwei Ports, einmal 3000 für discourse und einmal 80 für nginx (an der Stelle verstehe ich nicht, wieso noch einmal ein zweiter reverse proxy neben traefik benötigt wird ...):
Code:
docker inspect app | grep Name
"Name": "/app",
"Name": "always",
"Name": "overlay2"
"DNSNames": null
Code:
docker inspect app | grep IPAddress
"SecondaryIPAddresses": null,
"IPAddress": "172.17.0.2",
"IPAddress": "172.17.0.2",
Allerdings komme ich über curl nicht an den container heran:
Code:
curl app:80
curl: (6) Could not resolve host: app
Es muss doch möglich sein, an die IP bzw. den Namen eines anderen Services zu gelangen, ohne dass diese vorher bekannt ist? Ich habe bestimmt irgendetwas Einfaches (beim Hostname oder so) übersehen.
... Da mein Setup von der Standardinstallation abweicht, ist https://meta.discourse.org/t/instal...ing-recommended-supported-installation/300191 hier nur bedingt anwendbar.