neo4j размещается в облаке и работает в порту 11004
, другой контейнер с приложением готов к развертыванию, а порт 5000
открыт для доступа к приложению через браузер.
проблема в том, что приложение внутри контейнера должно извлекать данные из работающей базы данных.
что делать?
в веб-приложении:
driver = GraphDatabase.driver("bolt://localhost:11004", auth=("neo4j","1234"))
пробовал с http портами тоже,
FROM python:3.7
# Mount current directory to /app in the container image
VOLUME ./:app/
RUN apt-get update -y
RUN apt-get install -y python-pip python-dev build-essential
# Copy local directory to /app in container
# Dont use COPY * /app/ , * will lead to lose of folder structure in /app
COPY . /app/
# Change WORKDIR
WORKDIR /app
# Install dependencies
# use --proxy http://<proxy host>:port if you have proxy
RUN pip install -r requirements.txt
# In Docker, the containers themselves can have applications running on ports. To access these applications, we need to expose the containers internal port and bind the exposed port to a specified port on the host.
# Expose port and run the application when the container is started
RUN echo
ENTRYPOINT ["python"]
CMD ["app.py"]
EXPOSE 5000
Мне нужно приложение для извлечения данных через базу данных neo4j
, доступную через порт 11004
, и результаты веб-страницы через 5000