docker compose:
version: '3.9'
services:
django:
build: ./forum/
ports:
- "8000:8000"
restart: always
networks:
project_network:
telegram:
build: ./tgbot/
ports:
- "8080:8080"
restart: always
networks:
project_network:
networks:
project_network:
external: true
aiogram request:
response = requests.get('http://django:8000').text
await message.answer(response)
Django dockerfile
FROM python:3.10
WORKDIR /django
COPY . .
RUN pip install -r requirements.txt
CMD ["python", "manage.py", "runserver", "8000"]
change http://django:8000 to http://localhost:8000|
change outer and inner ports
New contributor
pftwop is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
9