-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ad68f36
commit 1e14433
Showing
1 changed file
with
21 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
# Use the official Open edX XBlock SDK image as the base image | ||
FROM openedx/xblock-sdk | ||
|
||
# Create the directory for the repository | ||
RUN mkdir -p /usr/local/src/{{cookiecutter.repo_name}} | ||
|
||
# Set the created directory as a Docker volume | ||
VOLUME ["/usr/local/src/{{cookiecutter.repo_name}}"] | ||
RUN apt-get update && apt-get install -y gettext | ||
RUN echo "pip install -r /usr/local/src/{{cookiecutter.repo_name}}/requirements.txt" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
RUN echo "pip install -e /usr/local/src/{{cookiecutter.repo_name}}" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
RUN echo "cd /usr/local/src/{{cookiecutter.repo_name}} && make compile_translations && cd /usr/local/src/xblock-sdk" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
RUN echo "exec python /usr/local/src/xblock-sdk/manage.py \"\$@\"" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
|
||
# Update the package list and install gettext | ||
RUN apt-get update && \ | ||
apt-get install -y gettext | ||
|
||
# Prepare the install_and_run_xblock script by appending necessary commands | ||
RUN echo "pip install -r /usr/local/src/{{cookiecutter.repo_name}}/requirements.txt" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh && \ | ||
echo "pip install -e /usr/local/src/{{cookiecutter.repo_name}}" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh && \ | ||
echo "cd /usr/local/src/{{cookiecutter.repo_name}} && make compile_translations && cd /usr/local/src/xblock-sdk" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh && \ | ||
echo "exec python /usr/local/src/xblock-sdk/manage.py \"\$@\"" >> /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
|
||
# Make the install_and_run_xblock script executable | ||
RUN chmod +x /usr/local/src/xblock-sdk/install_and_run_xblock.sh | ||
|
||
# Define the entrypoint to use the custom script | ||
ENTRYPOINT ["/bin/bash", "/usr/local/src/xblock-sdk/install_and_run_xblock.sh"] | ||
|
||
# Set the default command for the container | ||
CMD ["runserver", "0.0.0.0:8000"] |