Skip to content

Instantly share code, notes, and snippets.

@chrispruitt
Forked from dariodip/Dockerfile
Created February 5, 2021 01:22
Show Gist options
  • Save chrispruitt/a41417a4fee0921d2be131332beaa5bf to your computer and use it in GitHub Desktop.
Save chrispruitt/a41417a4fee0921d2be131332beaa5bf 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