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 all commits
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: 15 additions & 5 deletions dockerfiles/registrar.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,7 @@ 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 mkdir -p requirements

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

Expand All @@ -77,15 +75,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 requirements/devstack.txt https://raw.githubusercontent.com/edx/registrar/master/requirements/devstack.txt

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/requirements/devstack.txt

# 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 requirements/production.txt https://raw.githubusercontent.com/edx/registrar/master/requirements/production.txt

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/requirements/production.txt

# 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