Я пытаюсь запустить Apache Airflow в докере, и, несмотря на то, что веб-сервер, кажется, правильно включен, я могу получить доступ к веб-серверу с моего локального хоста.
Докер-Compose
version: '3'
services:
webserver:
build: .
container_name: data-webserver
depends_on:
- postgres
volumes:
- ./src:/src
ports:
- "8080:8080"
postgres:
image: postgres:latest
container_name: data-postgres
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
ports:
- "5432:5432"
Dockerfile
FROM ubuntu
ENV PYTHONUNBUFFERED 1
ADD . .
ADD ./docker_src/my_folder /etc
ENV PYTHONPATH "${PYTONPATH}:/maintenance:/database_utils:/utils"
RUN apt-get update && apt-get install -y python-pip mysql-server
RUN pip install -r docker_src/requirements.pip
CMD tail -f /dev/null
Инициирование воздушного потока:
airflow initdb
Веб-сервер воздушного потока:
airflow webserver -p 8080
Ответ веб-сервера Airflow:
2019-04-26 08:10:13 +0000] [31] [INFO] Starting gunicorn 19.9.0
[2019-04-26 08:10:13 +0000] [31] [INFO] Listening at: http://0.0.0.0:8080 (31)
[2019-04-26 08:10:13 +0000] [31] [INFO] Using worker: sync
[2019-04-26 08:10:13 +0000] [36] [INFO] Booting worker with pid: 36
[2019-04-26 08:10:13,684] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:10:13 +0000] [37] [INFO] Booting worker with pid: 37
[2019-04-26 08:10:13,746] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:10:13 +0000] [41] [INFO] Booting worker with pid: 41
[2019-04-26 08:10:13 +0000] [42] [INFO] Booting worker with pid: 42
[2019-04-26 08:10:13,850] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:10:13,866] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:10:13,974] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:10:14,058] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:10:14,156] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:10:14,164] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:10:34 +0000] [31] [INFO] Handling signal: winch
[2019-04-26 08:10:35 +0000] [31] [INFO] Handling signal: winch
[2019-04-26 08:10:44 +0000] [31] [INFO] Handling signal: ttin
[2019-04-26 08:10:44 +0000] [56] [INFO] Booting worker with pid: 56
[2019-04-26 08:10:44,937] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:10:45,143] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:10:45 +0000] [31] [INFO] Handling signal: ttou
[2019-04-26 08:10:45 +0000] [36] [INFO] Worker exiting (pid: 36)
[2019-04-26 08:11:16 +0000] [31] [INFO] Handling signal: ttin
[2019-04-26 08:11:16 +0000] [61] [INFO] Booting worker with pid: 61
[2019-04-26 08:11:16,198] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:11:16,441] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:11:17 +0000] [31] [INFO] Handling signal: ttou
[2019-04-26 08:11:17 +0000] [37] [INFO] Worker exiting (pid: 37)
[2019-04-26 08:11:47 +0000] [31] [INFO] Handling signal: ttin
[2019-04-26 08:11:47 +0000] [66] [INFO] Booting worker with pid: 66
[2019-04-26 08:11:47,453] {__init__.py:51} INFO - Using executor SequentialExecutor
[2019-04-26 08:11:47,670] {__init__.py:305} INFO - Filling up the DagBag from /root/airflow/dags
[2019-04-26 08:11:48 +0000] [31] [INFO] Handling signal: ttou
[2019-04-26 08:11:48 +0000] [41] [INFO] Worker exiting (pid: 41)
Когда я запускаю со своего компьютера: http://localhost:8080/
Я не могу зайти на сайт, хотя выставляю порт в docker-compose.
Где проблема?
Docke ps output
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
9aa56948cdf6 analytics-etl_webserver "/bin/sh -c 'tail -f…" 4 minutes ago Up 4 minutes 0.0.0.0:8080->8080/tcp data-webserver
20db5fd63ad8 postgres:latest "docker-entrypoint.s…" 4 hours ago Up 33 minutes 0.0.0.0:5432->5432/tcp data-postgres