python with docker async def SyntaxError: invalid syntax

python with docker async def SyntaxError: invalid syntax

I have python app in virtualenv that leverage async function calls

I have python app in virtualenv that leverage async function calls

Recently I tried moving my app to docker container, with following Dockerfile:

FROM python:3.7
ENV PYTHONUNBUFFERED 1
ADD . /code
WORKDIR /code

RUN pip install -r requirements.txt

CMD ["python3", "app.py"]

docker-compose.yml:

version: '3'
services:
  app:
    build: .
    volumes:
      - .:/code
    ports:
     - "8080:80"

unfortunately, when trying to run my container with docker-compose up I get following error:

    Starting app_1 ... done
Attaching to app_1
app_1  |   File "app.py", line 31
app_1  |     async def handle_DATA(self, server, session, envelope):
app_1  |             ^
app_1  | SyntaxError: invalid syntax
app_1 exited with code 1

What might be cause of this? As far as I know, from python 3.5 async is built-in in stdlib

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Linking python app docker and postgress docker

I have two docker containers running by the following commands:

Top Python Development Companies | Hire Python Developers

After analyzing clients and market requirements, TopDevelopers has come up with the list of the best Python service providers. These top-rated Python developers are widely appreciated for their professionalism in handling diverse projects. When...

WordPress in Docker. Part 1: Dockerization

This entry-level guide will tell you why and how to Dockerize your WordPress projects.