From faeda45001edf6604e36b22084e756d8e852c053 Mon Sep 17 00:00:00 2001 From: Mustafa Gezen Date: Thu, 2 Feb 2023 03:31:10 +0100 Subject: [PATCH] Let's just push the containers manually for now --- .dockerignore | 4 ++++ .github/workflows/push_containers.yaml | 19 +++++++++++++++---- apollo/rhworker/Dockerfile | 13 +++++++++++++ apollo/rpmworker/Dockerfile | 13 +++++++++++++ apollo/server/Dockerfile | 13 +++++++++++++ 5 files changed, 58 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 apollo/rhworker/Dockerfile create mode 100644 apollo/rpmworker/Dockerfile create mode 100644 apollo/server/Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..5b34fe7 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,4 @@ +node_modules +.venv +.ijwb +.idea \ No newline at end of file diff --git a/.github/workflows/push_containers.yaml b/.github/workflows/push_containers.yaml index 2796681..e20ed87 100644 --- a/.github/workflows/push_containers.yaml +++ b/.github/workflows/push_containers.yaml @@ -18,10 +18,21 @@ jobs: with: path: "~/.cache/bazel" key: bazel - - name: Log into GCR + - name: Log into GHCR run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u "${{ github.actor }}" --password-stdin - name: Push containers run: | - bazel run //apollo/server:server.push - bazel run //apollo/rpmworker:rpmworker.push - bazel run //apollo/rhworker:rhworker.push + export BUILD_TAG="${GIT_COMMIT:-$(git describe --tags --long --always)}" + + bazel build //apollo/server/static + rm -rf apollo/server/static/* + cp bazel-bin/apollo/server/static/*.css apollo/server/static/ + cp bazel-bin/apollo/server/static/*.js apollo/server/static/ + cp bazel-bin/apollo/server/static/*.map apollo/server/static/ + + docker build -t ghcr.io/resf/apollo-server:$BUILD_TAG -f apollo/server/Dockerfile . + docker build -t ghcr.io/resf/apollo-rpmworker:$BUILD_TAG -f apollo/rpmworker/Dockerfile . + docker build -t ghcr.io/resf/apollo-rhworker:$BUILD_TAG -f apollo/rhworker/Dockerfile . + docker push ghcr.io/resf/apollo-server:$BUILD_TAG + docker push ghcr.io/resf/apollo-rpmworker:$BUILD_TAG + docker push ghcr.io/resf/apollo-rhworker:$BUILD_TAG diff --git a/apollo/rhworker/Dockerfile b/apollo/rhworker/Dockerfile new file mode 100644 index 0000000..a37c369 --- /dev/null +++ b/apollo/rhworker/Dockerfile @@ -0,0 +1,13 @@ +FROM rockylinux:9 + +WORKDIR /app + +RUN dnf update -y && dnf install -y python3 python3-pip +RUN python3 -m venv /opt/venv + +COPY requirements_lock.txt . +RUN /opt/venv/bin/pip3 install -r requirements_lock.txt + +COPY . . + +CMD ["/opt/venv/bin/python3", "-m", "apollo.rhworker"] diff --git a/apollo/rpmworker/Dockerfile b/apollo/rpmworker/Dockerfile new file mode 100644 index 0000000..6fbe1bc --- /dev/null +++ b/apollo/rpmworker/Dockerfile @@ -0,0 +1,13 @@ +FROM rockylinux:9 + +WORKDIR /app + +RUN dnf update -y && dnf install -y python3 python3-pip +RUN python3 -m venv /opt/venv + +COPY requirements_lock.txt . +RUN /opt/venv/bin/pip3 install -r requirements_lock.txt + +COPY . . + +CMD ["/opt/venv/bin/python3", "-m", "apollo.rpmworker"] diff --git a/apollo/server/Dockerfile b/apollo/server/Dockerfile new file mode 100644 index 0000000..708cd9b --- /dev/null +++ b/apollo/server/Dockerfile @@ -0,0 +1,13 @@ +FROM rockylinux:9 + +WORKDIR /app + +RUN dnf update -y && dnf install -y python3 python3-pip +RUN python3 -m venv /opt/venv + +COPY requirements_lock.txt . +RUN /opt/venv/bin/pip3 install -r requirements_lock.txt + +COPY . . + +CMD ["/opt/venv/bin/python3", "-m", "hypercorn", "apollo.server.server", "--bind", "0.0.0.0:8000"]