diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml deleted file mode 100644 index 0452cf22..00000000 --- a/.github/workflows/docker-publish.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Push Docker Images - -on: - push: - branches: - - main -jobs: - # Push image to GitHub Packages. - # See also https://docs.docker.com/docker-hub/builds/ - push: - runs-on: ubuntu-latest - if: github.event_name == 'push' - - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Build and Push docker image - env: - DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }} - DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }} - run : make github_docker_push diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index 082d7435..00000000 --- a/Dockerfile +++ /dev/null @@ -1,66 +0,0 @@ -FROM ubuntu:focal as app -MAINTAINER sre@edx.org - - -# Packages installed: - -# gcc; for compiling python extensions distributed with python packages like mysql-client -# git; for pulling requirements from GitHub. -# language-pack-en locales; ubuntu locale support so that system utilities have a consistent language and time zone. -# libmysqlclient-dev; to install header files needed to use native C implementation for MySQL-python for performance gains. -# libssl-dev; # mysqlclient wont install without this. -# pkg-config is now required for libmysqlclient-dev and its python dependencies -# python3-dev; to install header files for python extensions; much wheel-building depends on this -# python3-pip; install pip to install application requirements.txt files -# python; ubuntu doesnt ship with python, so this is the python we will use to run the application - -# If you add a package here please include a comment above describing what it is used for -RUN apt-get update && apt-get -qy install --no-install-recommends \ - gcc \ - git \ - language-pack-en \ - libmysqlclient-dev \ - libssl-dev \ - locales \ - pkg-config \ - python3-dev \ - python3-pip \ - python3.8 - - -RUN pip install --upgrade pip setuptools -# delete apt package lists because we do not need them inflating our image -RUN rm -rf /var/lib/apt/lists/* - -RUN ln -s /usr/bin/python3 /usr/bin/python - -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 -ENV DJANGO_SETTINGS_MODULE commerce_coordinator.settings.production - -EXPOSE 8140 -RUN useradd -m --shell /bin/false app - -WORKDIR /edx/app/commerce-coordinator - -# Copy the requirements explicitly even though we copy everything below -# this prevents the image cache from busting unless the dependencies have changed. -COPY requirements/production.txt /edx/app/commerce-coordinator/requirements/production.txt - -# Dependencies are installed as root so they cannot be modified by the application user. -RUN pip install -r requirements/production.txt - -RUN mkdir -p /edx/var/log - -# Code is owned by root so it cannot be modified by the application user. -# So we copy it before changing users. -USER app - -# Gunicorn 19 does not log to stdout or stderr by default. Once we are past gunicorn 19, the logging to STDOUT need not be specified. -CMD gunicorn --workers=2 --name commerce-coordinator -c /edx/app/commerce-coordinator/commerce_coordinator/docker_gunicorn_configuration.py --log-file - --max-requests=1000 commerce-coordinator.wsgi:application - -# This line is after the requirements so that changes to the code will not -# bust the image cache -COPY . /edx/app/commerce-coordinator diff --git a/Makefile b/Makefile index 30c79300..5e9eb997 100644 --- a/Makefile +++ b/Makefile @@ -155,17 +155,11 @@ start-devstack: ## run a local development copy of the server open-devstack: ## open a shell on the server started by start-devstack docker exec -it commerce-coordinator /edx/app/commerce-coordinator/devstack.sh open -pkg-devstack: ## build the commerce-coordinator image from the latest configuration and code - docker build -t commerce-coordinator:latest -f docker/build/commerce-coordinator/Dockerfile git://github.com/openedx/configuration - detect_changed_source_translations: ## check if translation files are up-to-date cd commerce_coordinator && i18n_tool changed validate_translations: fake_translations detect_changed_source_translations ## install fake translations and check if translation files are up-to-date -docker_build: - docker build . -f Dockerfile -t openedx/commerce-coordinator - dev.provision_docker: # start LMS, and Setup a clean commerce-coordinator stack. bash provision-commerce-coordinator.sh @@ -176,9 +170,6 @@ dev.run_test_query: dev.up: # Starts all containers docker-compose up -d -dev.up.build: - docker-compose up -d --build - dev.down: # Kills containers and all of their data that isn't in volumes docker-compose down @@ -187,7 +178,7 @@ dev.stop: # Stops containers so they can be restarted dev.multistack.up: bash find-start-lms.sh - docker-compose up -d --build + docker-compose up -d dev.multistack.stop: docker compose -p devstack stop @@ -212,19 +203,6 @@ db-shell: # Run the app shell as root, enter the app's database %-attach: docker attach commerce_coordinator.$* -github_docker_build: - docker build . -f Dockerfile --target app -t openedx/commerce-coordinator - -github_docker_tag: github_docker_build - docker tag openedx/commerce-coordinator openedx/commerce-coordinator:${GITHUB_SHA} - -github_docker_auth: - echo "$$DOCKERHUB_PASSWORD" | docker login -u "$$DOCKERHUB_USERNAME" --password-stdin - -github_docker_push: github_docker_tag github_docker_auth ## push to docker hub - docker push 'openedx/commerce-coordinator:latest' - docker push "openedx/commerce-coordinator:${GITHUB_SHA}" - selfcheck: ## check that the Makefile is well-formed @echo "The Makefile is well-formed." diff --git a/docker-compose.yml b/docker-compose.yml index 636dfc26..69f7ab62 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,8 +14,7 @@ services: container_name: commerce-coordinator.memcache app: - image: devstack # this should exist locally from previous devstack, we will build our Dockerfile - build: . # Build Dockerfile if we need to. + image: edxops/commerce-coordinator-dev container_name: commerce-coordinator.app volumes: - .:/edx/app/commerce-coordinator/ diff --git a/provision-commerce-coordinator.sh b/provision-commerce-coordinator.sh index dfdef86d..d81b7ae6 100644 --- a/provision-commerce-coordinator.sh +++ b/provision-commerce-coordinator.sh @@ -12,10 +12,7 @@ NC="\x1B[0m" bash ./find-start-lms.sh docker-compose down -v # its ok if this fails. -docker-compose up -d --build - -# Install requirements -# Can be skipped right now because we're using the --build flag on docker-compose. This will need to be changed once we move to devstack. +docker-compose up -d # Wait for MySQL echo "Waiting for MySQL"