Skip to content

Commit 0b48f27

Browse files
authored
build: Restore .dockerignore to improve image build and caching (#36877)
edx-platform's Dockerfile was removed in Jan 2025 because the community was not maintaining or using it. The PR that removed it [1] also removed the .dockerfile as an effort to clean up unnecessary Docker-related files from the repo. However, the .dockerignore file serves an important purpose for *any* Docker image based on edx-platform: it identifies which files and paths aren't relevant for the functioning of the image. For example, Tutor greatly benefited from this file, because by ignoring unnecessary files, the build context was shrunk and image cache layers were less likely to be unnecesarily invalidated. We restore the .dockerfile as it was previously in Sumac [2], with the addition of /venv, /.venv, and __pycache__, and with the removal of /Dockerfile (as it no longer exists). [1] #35731 [2] https://github.com/openedx/edx-platform/blob/open-release/sumac.master/.dockerignore
1 parent 89e3d18 commit 0b48f27

1 file changed

Lines changed: 153 additions & 0 deletions

File tree

.dockerignore

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# .dockerignore for edx-platform.
2+
# There's a lot here, please try to keep it organized.
3+
4+
### Files that are not needed in the docker file
5+
6+
/test_root/
7+
.git
8+
9+
### Files private to developers
10+
11+
# Files that should be git-ignored, but are hand-edited or otherwise valued,
12+
# and so should not be destroyed by "make clean".
13+
# start-noclean
14+
requirements/private.txt
15+
requirements/edx/private.in
16+
requirements/edx/private.txt
17+
lms/envs/private.py
18+
cms/envs/private.py
19+
# end-noclean
20+
21+
### Python artifacts
22+
**/*.pyc
23+
**/__pycache__
24+
.venv
25+
venv
26+
27+
### Editor and IDE artifacts
28+
**/*~
29+
**/*.swp
30+
**/*.orig
31+
**/nbproject
32+
**/.idea/
33+
**/.redcar/
34+
**/codekit-config.json
35+
**/.pycharm_helpers/
36+
**/_mac/*
37+
**/IntelliLang.xml
38+
**/conda_packages.xml
39+
**/databaseSettings.xml
40+
**/diff.xml
41+
**/debugger.xml
42+
**/editor.xml
43+
**/ide.general.xml
44+
**/inspection/Default.xml
45+
**/other.xml
46+
**/packages.xml
47+
**/web-browsers.xml
48+
49+
### NFS artifacts
50+
**/.nfs*
51+
52+
### OS X artifacts
53+
**/*.DS_Store
54+
**/.AppleDouble
55+
**/:2e_*
56+
**/:2e#
57+
58+
### Internationalization artifacts
59+
**/*.mo
60+
**/*.po
61+
**/*.prob
62+
**/*.dup
63+
!**/django.po
64+
!**/django.mo
65+
!**/djangojs.po
66+
!**/djangojs.mo
67+
conf/locale/en/LC_MESSAGES/*.mo
68+
conf/locale/fake*/LC_MESSAGES/*.po
69+
conf/locale/fake*/LC_MESSAGES/*.mo
70+
71+
### Testing artifacts
72+
**/.testids/
73+
**/.noseids
74+
**/nosetests.xml
75+
**/.cache/
76+
**/.coverage
77+
**/.coverage.*
78+
**/coverage.xml
79+
**/cover/
80+
**/cover_html/
81+
**/reports/
82+
**/jscover.log
83+
**/jscover.log.*
84+
**/.pytest_cache/
85+
**/pytest_task*.txt
86+
**/.tddium*
87+
common/test/data/test_unicode/static/
88+
test_root/courses/
89+
test_root/data/test_bare.git/
90+
test_root/export_course_repos/
91+
test_root/paver_logs/
92+
test_root/uploads/
93+
**/django-pyfs
94+
**/.tox/
95+
common/test/data/badges/*.png
96+
97+
### Installation artifacts
98+
**/*.egg-info
99+
**/.pip_download_cache/
100+
**/.prereqs_cache
101+
**/.vagrant/
102+
**/node_modules
103+
**/bin/
104+
105+
### Static assets pipeline artifacts
106+
**/*.scssc
107+
lms/static/css/
108+
lms/static/certificates/css/
109+
cms/static/css/
110+
common/static/common/js/vendor/
111+
common/static/common/css/vendor/
112+
common/static/bundles
113+
**/webpack-stats.json
114+
115+
### Styling generated from templates
116+
lms/static/sass/*.css
117+
lms/static/sass/*.css.map
118+
lms/static/certificates/sass/*.css
119+
lms/static/themed_sass/
120+
cms/static/css/
121+
cms/static/sass/*.css
122+
cms/static/sass/*.css.map
123+
cms/static/themed_sass/
124+
themes/**/css
125+
126+
### Logging artifacts
127+
**/log/
128+
**/logs
129+
**/chromedriver.log
130+
**/ghostdriver.log
131+
132+
### Celery artifacts ###
133+
**/celerybeat-schedule
134+
135+
### Unknown artifacts
136+
**/database.sqlite
137+
**/courseware/static/js/mathjax/*
138+
**/flushdb.sh
139+
**/build
140+
/src/
141+
\#*\#
142+
**/.env/
143+
openedx/core/djangoapps/django_comment_common/comment_client/python
144+
**/autodeploy.properties
145+
**/.ws_migrations_complete
146+
**/dist
147+
**/*.bak
148+
149+
# Visual Studio Code
150+
**/.vscode
151+
152+
# Locally generated PII reports
153+
**/pii_report

0 commit comments

Comments
 (0)