возникла необходимость подключить python модуль(функцию из файла) из другого Docker контейнера,сколько бьюсь, не могу понять как это сделать и вообще возможно ли)
Папки проекта
Docker compose:
version: "3.7"
services:
flask:
build: ./flask
container_name: flask
restart: always
environment:
- APP_NAME=MyFlaskApp
expose:
- 8080
volumes:
- "/home/nikita/app/telegram_bot"
telegram_bot:
build: ./telegram_bot
container_name: telegram_bot
restart: always
nginx:
build: ./nginx
container_name: nginx
restart: always
ports:
- "80:80"
Docker файл из flask:
FROM python:3.8
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install the dependencies
RUN pip install -r requirements.txt
# run the command to start uWSGI
CMD ["uwsgi", "app.ini"]
Docker файл из telegram_bot:
FROM python:3.8
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
ADD . /app
# Install the dependencies
RUN pip install -r requirements.txt
# run the command to start uWSGI
CMD ["python", "./main_bot.py"]
Задача подгрузить функцию из main_bot.py, во flask.