Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perf: optimised to handle dependecies cache #7

Merged
merged 2 commits into from
Oct 9, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 14 additions & 6 deletions dockerfiles/registrar.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,6 @@ ENV REGISTRAR_CODE_DIR ${REGISTRAR_CODE_DIR}
# Working directory will be root of repo.
WORKDIR ${REGISTRAR_CODE_DIR}
huniafatima-arbi marked this conversation as resolved.
Show resolved Hide resolved

# cloning git repo
RUN curl -L https://github.com/edx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1


RUN virtualenv -p python${PYTHON_VERSION} --always-copy ${REGISTRAR_VENV_DIR}

RUN pip install --upgrade pip setuptools
Expand All @@ -77,15 +73,27 @@ EXPOSE 18735

FROM app as dev

RUN pip install --no-cache-dir -r requirements/devstack.txt
# fetching the requirement file that is needed
RUN curl -L -o devstack.txt https://raw.githubusercontent.com/edx/registrar/master/requirements/devstack.txt
huniafatima-arbi marked this conversation as resolved.
Show resolved Hide resolved

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/devstack.txt
huniafatima-arbi marked this conversation as resolved.
Show resolved Hide resolved

# cloning the repository after requirements installation
RUN curl -L https://github.com/edx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1

ENV DJANGO_SETTINGS_MODULE registrar.settings.devstack

CMD while true; do python ./manage.py runserver 0.0.0.0:18734; sleep 2; done

FROM app as prod

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/requirements/production.txt
# fetching the requirement file that is needed
RUN curl -L -o production.txt https://raw.githubusercontent.com/edx/registrar/master/requirements/production.txt
huniafatima-arbi marked this conversation as resolved.
Show resolved Hide resolved

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/production.txt
huniafatima-arbi marked this conversation as resolved.
Show resolved Hide resolved

# cloning the repository after requirements installation
RUN curl -L https://github.com/edx/registrar/archive/refs/heads/master.tar.gz | tar -xz --strip-components=1

ENV DJANGO_SETTINGS_MODULE registrar.settings.production

Expand Down