Skip to content

Instantly share code, notes, and snippets.

@dariodip
Created September 21, 2017 09:45
Show Gist options
  • Save dariodip/4e0133eaa8733e4206ccdb48e7af6a90 to your computer and use it in GitHub Desktop.
Save dariodip/4e0133eaa8733e4206ccdb48e7af6a90 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")
)
@amith23
Copy link

amith23 commented Aug 7, 2021

this was super helpful thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment