Skip to content

Instantly share code, notes, and snippets.

@atkallie
Forked from dariodip/Dockerfile
Created November 3, 2022 18:03
Show Gist options
  • Save atkallie/3a19ced4a91141f40f0b69145527fab3 to your computer and use it in GitHub Desktop.
Save atkallie/3a19ced4a91141f40f0b69145527fab3 to your computer and use it in GitHub Desktop.
Cython in a Docker container
import hello
hello.say_hello_to('Dario')
FROM python:3.6
WORKDIR /app
ADD . /app
RUN pip install -r requirements.txt
RUN python setup.py build_ext --inplace
ENTRYPOINT ["python"]
CMD ["app.py"]
def say_hello_to(name):
print("Hello %s!" % name)
from distutils.core import setup
from Cython.Build import cythonize
setup(
name= 'Hello world',
ext_modules = cythonize("hello.pyx")
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment