From b84f8ce46b7ae8f711405f2606c936d76fce4d60 Mon Sep 17 00:00:00 2001 From: Hunia Fatima Date: Fri, 25 Oct 2024 17:16:01 +0500 Subject: [PATCH] chore: remove dockerfile setup --- .github/workflows/docker-publish.yml | 64 -------------------- Dockerfile | 89 ---------------------------- 2 files changed, 153 deletions(-) delete mode 100644 .github/workflows/docker-publish.yml delete mode 100644 Dockerfile diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 9e48086f964..00000000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,64 +0,0 @@ -name: Build and Push Docker Images - -on: - push: - branches: - - master - - open-release/** -jobs: - push: - runs-on: ubuntu-latest - - steps: - - name: Checkout - uses: actions/checkout@v3 - - # Use the release name as the image tag if we're building an open release tag. - # Examples: if we're building 'open-release/olive.master', tag the image as 'olive.master'. - # Otherwise, we must be building from a push to master, so use 'latest'. - - name: Get tag name - id: get-tag-name - uses: actions/github-script@v5 - with: - script: | - const branchName = context.ref.split('/').slice(-1)[0]; - const tagName = branchName === 'master' ? 'latest' : branchName; - console.log('Will use tag: ' + tagName); - return tagName; - result-encoding: string - - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v2 - - - name: Set up QEMU - uses: docker/setup-qemu-action@v2 - - - name: Login to DockerHub - uses: docker/login-action@v2 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - - - name: Build and push Dev Docker image - uses: docker/build-push-action@v4 - with: - push: true - target: dev - repository: edxops/ecommerce-dev - tags: | - edxops/ecommerce-dev:${{ steps.get-tag-name.outputs.result }} - edxops/ecommerce-dev:${{ github.sha }} - platforms: linux/amd64,linux/arm64 - - # The current priority is to get the devstack off of Ansible based Images. Once that is done, we can come back to this part to get - # suitable images for smaller prod environments. - # - name: Build and push prod Docker image - # uses: docker/build-push-action@v4 - # with: - # push: true - # target: prod - # repository: edxops/ecommerce-prod - # tags: | - # edxops/ecommerce-prod:${{ steps.get-tag-name.outputs.result }} - # edxops/ecommerce-prod:${{ github.sha }} - # platforms: linux/amd64,linux/arm64 diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 5eeb76fe686..00000000000 --- a/Dockerfile +++ /dev/null @@ -1,89 +0,0 @@ -FROM ubuntu:focal as app - -ENV DEBIAN_FRONTEND noninteractive -# System requirements. -RUN apt update && \ - apt-get install -qy \ - curl \ - git \ - language-pack-en \ - build-essential \ - python3.8-dev \ - python3-virtualenv \ - python3.8-distutils \ - libmysqlclient-dev \ - libssl-dev \ - libcairo2-dev && \ - rm -rf /var/lib/apt/lists/* - -# Use UTF-8. -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -ARG COMMON_APP_DIR="/edx/app" -ARG COMMON_CFG_DIR="/edx/etc" -ARG SERVICE_NAME="ecommerce" -ARG ECOMMERCE_APP_DIR="${COMMON_APP_DIR}/${SERVICE_NAME}" -ARG ECOMMERCE_VENV_DIR="${COMMON_APP_DIR}/${SERVICE_NAME}/venvs/${SERVICE_NAME}" -ARG ECOMMERCE_CODE_DIR="${ECOMMERCE_APP_DIR}/${SERVICE_NAME}" -ARG ECOMMERCE_NODEENV_DIR="${ECOMMERCE_APP_DIR}/nodeenvs/${SERVICE_NAME}" - -ENV ECOMMERCE_CFG "${COMMON_CFG_DIR}/ecommerce.yml" -ENV ECOMMERCE_CODE_DIR "${ECOMMERCE_CODE_DIR}" -ENV ECOMMERCE_APP_DIR "${ECOMMERCE_APP_DIR}" - -# Add virtual env and node env to PATH, in order to activate them -ENV PATH "${ECOMMERCE_VENV_DIR}/bin:${ECOMMERCE_NODEENV_DIR}/bin:$PATH" - -RUN virtualenv -p python3.8 --always-copy ${ECOMMERCE_VENV_DIR} - -RUN pip install nodeenv - -RUN nodeenv ${ECOMMERCE_NODEENV_DIR} --node=16.14.0 --prebuilt && npm install -g npm@8.5.x - -# Set working directory to the root of the repo -WORKDIR ${ECOMMERCE_CODE_DIR} - -# Install JS requirements -COPY package.json package.json -COPY package-lock.json package-lock.json -COPY bower.json bower.json -RUN npm install --production && ./node_modules/.bin/bower install --allow-root --production - -# Expose canonical ecommerce port -EXPOSE 18130 - -FROM app as prod - -ENV DJANGO_SETTINGS_MODULE "ecommerce.settings.production" - -COPY requirements/production.txt ${ECOMMERCE_CODE_DIR}/requirements/production.txt - -RUN pip install -r ${ECOMMERCE_CODE_DIR}/requirements/production.txt - -# Copy over rest of code. -# We do this AFTER requirements so that the requirements cache isn't busted -# every time any bit of code is changed. -COPY . . - -CMD gunicorn --bind=0.0.0.0:18130 --workers 2 --max-requests=1000 -c ecommerce/docker_gunicorn_configuration.py ecommerce.wsgi:application - -FROM app as dev - -ENV DJANGO_SETTINGS_MODULE "ecommerce.settings.devstack" - -COPY requirements/dev.txt ${ECOMMERCE_CODE_DIR}/requirements/dev.txt - -RUN pip install -r ${ECOMMERCE_CODE_DIR}/requirements/dev.txt - -# Devstack related step for backwards compatibility -RUN touch ${ECOMMERCE_APP_DIR}/ecommerce_env - -# Copy over rest of code. -# We do this AFTER requirements so that the requirements cache isn't busted -# every time any bit of code is changed. -COPY . . - -CMD while true; do python ./manage.py runserver 0.0.0.0:18130; sleep 2; done