Skip to content

Commit 34a3dc0

Browse files
committed
Add comment.
1 parent b9eb735 commit 34a3dc0

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Dockerfile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,12 @@ RUN rm ./python/lib/$runtime/site-packages/ddtrace/internal/datadog/profiling/st
2626
RUN find . -name "*.dist-info" -type d | xargs rm -rf
2727

2828

29+
# Precompile all .pyc files and remove .py files. This speeds up load time.
30+
# Compile with optimization level 2 (-o 2) and PYTHONNODEBUGRANGES=1 to redtce
31+
# size of .pyc files.
32+
# See https://docs.python.org/3/tutorial/modules.html#compiled-python-files
33+
# https://docs.python.org/3.11/using/cmdline.html#cmdoption-O
34+
# https://docs.python.org/3/using/cmdline.html#envvar-PYTHONNODEBUGRANGES
2935
RUN PYTHONNODEBUGRANGES=1 python -m compileall -o 2 -b ./python/lib/$runtime/site-packages
3036
RUN find ./python/lib/$runtime/site-packages -name \*.py -delete
3137
RUN find ./python/lib/$runtime/site-packages -name __pycache__ -type d -exec rm -r {} \+

0 commit comments

Comments
 (0)