From fbaa150c5c27bdeba46437f86ff0f88bdbff0fd9 Mon Sep 17 00:00:00 2001 From: Opnxng Date: Wed, 21 Feb 2024 13:25:27 +0800 Subject: [PATCH] Fixed Rat Aint Tieba --- .gitea/workflows/rat-aint-tieba.yaml | 4 +++- dockerfiles/rat-aint-tieba.Dockerfile | 23 +++++++++++++++++++++++ 2 files changed, 26 insertions(+), 1 deletion(-) create mode 100644 dockerfiles/rat-aint-tieba.Dockerfile diff --git a/.gitea/workflows/rat-aint-tieba.yaml b/.gitea/workflows/rat-aint-tieba.yaml index 35bc4ce..9b5527b 100644 --- a/.gitea/workflows/rat-aint-tieba.yaml +++ b/.gitea/workflows/rat-aint-tieba.yaml @@ -46,6 +46,8 @@ jobs: cd temp git clone ${REMOTE_REPO} . git checkout no-masters # Use no-masters branch + # Workaround to fix Docker build + curl -JL https://git.opnxng.com/opnxng/docker-images/raw/branch/main/dockerfiles/rat-aint-tieba.Dockerfile -o Dockerfile docker-buildx build \ --platform ${BUILD_PLATFORM} \ -t git.opnxng.com/${{ gitea.repository_owner }}/${REPO_NAME}:latest \ @@ -70,4 +72,4 @@ jobs: STORED_COMMIT=$(curl -H "Authorization: Bearer ${{ secrets.NT }}" -s "https://nt.opnxng.com/${REPO_NAME}/raw?poll=1" | tail -n 1) echo "STORED_COMMIT=${STORED_COMMIT}" >> "$GITHUB_ENV" exit 1 - fi \ No newline at end of file + fi diff --git a/dockerfiles/rat-aint-tieba.Dockerfile b/dockerfiles/rat-aint-tieba.Dockerfile new file mode 100644 index 0000000..59e8c45 --- /dev/null +++ b/dockerfiles/rat-aint-tieba.Dockerfile @@ -0,0 +1,23 @@ +# Use the official Python image as the base image +FROM python:3.11-slim + +# Install the patch utility +RUN apt-get update && apt-get install -y patch + +# Set the working directory to /app +WORKDIR /app + +# Copy the local requirements.txt file to the container +COPY requirements.txt . + +# Install the Python dependencies +RUN pip install -r requirements.txt + +# Expose port 8886 +EXPOSE 8886 + +# Copy the local code to the container +COPY . . + +# Run the Python script with Uvicorn, binding to all available network interfaces +CMD ["gunicorn", "app:proxified", "--max-requests", "50", "--worker-class", "uvicorn.workers.UvicornWorker", "-b", "0.0.0.0:8886"]