Skip to content

Commit

Permalink
perf: optimised to handle dependecies cache
Browse files Browse the repository at this point in the history
  • Loading branch information
huniafatima-arbi committed Oct 7, 2024
1 parent fcbfd84 commit 34e9d60
Showing 1 changed file with 14 additions and 6 deletions.
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}

# 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

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/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 production.txt https://raw.githubusercontent.com/edx/registrar/master/requirements/production.txt

RUN pip install --no-cache-dir -r ${REGISTRAR_CODE_DIR}/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

0 comments on commit 34e9d60

Please sign in to comment.