diff --git a/.dockerignore b/.dockerignore deleted file mode 100644 index 63380740..00000000 --- a/.dockerignore +++ /dev/null @@ -1,6 +0,0 @@ -.tox -coverage -coverage.xml -Dockerfile -geckodriver.log -htmlcov diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 0cb1ce37..00000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,48 +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: Build and push Dev Docker image - uses: docker/build-push-action@v1 - with: - push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - target: dev - repository: edxops/xqueue-dev - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} - - - name: Build and push prod Docker image - uses: docker/build-push-action@v1 - with: - push: true - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_PASSWORD }} - target: production - repository: edxops/xqueue-prod - tags: ${{ steps.get-tag-name.outputs.result }},${{ github.sha }} \ No newline at end of file diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index fd461be5..00000000 --- a/Dockerfile +++ /dev/null @@ -1,71 +0,0 @@ -FROM ubuntu:focal as app - -# System requirements - -RUN apt-get update && \ - apt-get upgrade -qy && DEBIAN_FRONTEND=noninteractive apt-get install language-pack-en locales git \ - python3.8-dev python3-virtualenv libmysqlclient-dev libssl-dev build-essential pkg-config wget unzip -qy && \ - rm -rf /var/lib/apt/lists/* - -# Python is Python3. -RUN ln -s /usr/bin/python3 /usr/bin/python - -# 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 XQUEUE_APP_DIR="${COMMON_APP_DIR}/xqueue" -ENV XQUEUE_APP_DIR="${COMMON_APP_DIR}/xqueue" -ENV XQUEUE_VENV_DIR="${COMMON_APP_DIR}/xqueue/venvs/xqueue" -ENV XQUEUE_CODE_DIR="${XQUEUE_APP_DIR}/xqueue" - -ENV PATH="$XQUEUE_VENV_DIR/bin:$PATH" - -# Working directory will be root of repo. -WORKDIR ${XQUEUE_CODE_DIR} - -RUN virtualenv -p python3.8 --always-copy ${XQUEUE_VENV_DIR} - -# Copy just Python requirements & install them. -COPY requirements ${XQUEUE_CODE_DIR}/requirements -COPY requirements.txt ${XQUEUE_APP_DIR}/requirements.txt -COPY Makefile ${XQUEUE_CODE_DIR} - -# placeholder file for the time being unless devstack provisioning scripts need it. -RUN touch ${XQUEUE_APP_DIR}/xqueue_env - -# Expose ports. -EXPOSE 8040 - -FROM app as dev - -# xqueue service config commands below -RUN pip install -r ${XQUEUE_CODE_DIR}/requirements/dev.txt - -# After the requirements so changes to the code will not bust the image cache -COPY . ${XQUEUE_CODE_DIR}/ - -ENV DJANGO_SETTINGS_MODULE xqueue.devstack - -CMD while true; do python ./manage.py runserver 0.0.0.0:8040; sleep 2; done - -FROM app as production - -# xqueue service config commands below -RUN pip install -r ${XQUEUE_APP_DIR}/requirements.txt - -# After the requirements so changes to the code will not bust the image cache -COPY . ${XQUEUE_CODE_DIR}/ - -ENV DJANGO_SETTINGS_MODULE xqueue.production - -CMD gunicorn \ - --pythonpath=/edx/app/xqueue/xqueue \ - --timeout=300 \ - -b 0.0.0.0:8040 \ - -w 2 \ - - xqueue.wsgi:application