Skip to content

Commit

Permalink
feat: add bindmount option for development
Browse files Browse the repository at this point in the history
  • Loading branch information
MoisesGSalas committed Feb 8, 2025
1 parent 8a9e678 commit 99146df
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tutorcodejail/patches/local-docker-compose-dev-services
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
codejailservice:
command: flask run --host 0.0.0.0 --port 8550
command: flask run --debug --host 0.0.0.0 --port 8550
environment:
FLASK_ENV: development
FLASK_APP_SETTINGS: codejailservice.tutor.DevelopmentConfig
ports:
- "8550:8550"
restart: unless-stopped
volumes:
{%- for mount in iter_mounts(MOUNTS, "codejailservice") %}
- {{ mount }}
{%- endfor %}
14 changes: 14 additions & 0 deletions tutorcodejail/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,20 @@ def get_apparmor_abi():
]
)

@hooks.Filters.COMPOSE_MOUNTS.add()
def _mount_codejailservice(
volumes: list[tuple[str, str]], path_basename: str
) -> list[tuple[str, str]]:
"""
Bindmount the codejailservice code to the container using
`tutor mount add /path/to/codejailservice`.
"""
if path_basename == "codejailservice":
path = "/openedx/codejailservice"
volumes.append(("codejailservice", path))
return volumes


# To add a custom initialization task, create a bash script template under:
# tutorcodejail/templates/codejail/tasks/
# and then add it to the MY_INIT_TASKS list. Each task is in the format:
Expand Down

0 comments on commit 99146df

Please sign in to comment.