Spaces:
Runtime error
Runtime error
| # Use an official Python runtime as a parent image | |
| FROM python:3.11 | |
| # WORKDIR /app | |
| # Install required C++11 libraries and ca-certificates | |
| # RUN apt-get update -qq \ | |
| # && apt-get install -y \ | |
| # build-essential \ | |
| # python3-dev \ | |
| # ca-certificates \ | |
| # && apt-get clean \ | |
| # && rm -rf /var/lib/apt/lists/* | |
| # Install dependencies for Selenium and Chrome | |
| # RUN apt-get update && apt-get install -y \ | |
| # wget \ | |
| # unzip \ | |
| # curl \ | |
| # gnupg \ | |
| # libnss3 \ | |
| # libgconf-2-4 \ | |
| # libxi6 \ | |
| # libxcursor1 \ | |
| # libxrandr2 \ | |
| # libxss1 \ | |
| # libxtst6 \ | |
| # fonts-liberation \ | |
| # xdg-utils \ | |
| # libatk-bridge2.0-0 \ | |
| # libgtk-3-0 \ | |
| # --no-install-recommends && \ | |
| # apt-get clean && \ | |
| # rm -rf /var/lib/apt/lists/* | |
| # RUN apt-get update && apt-get install -y wget unzip && \ | |
| # wget https://dl.google.com/Linux/direct/google-chrome-stable_current_amd64.deb && \ | |
| # apt install -y ./google-chrome-stable_current_amd64.deb && \ | |
| # rm google-chrome-stable_current_amd64.deb && \ | |
| # apt-get clean | |
| # # Get secret HF_HOME and output it to /test at buildtime | |
| # RUN --mount=type=secret,id=HF_HOME,mode=0444,required=true \ | |
| # cat /run/secrets/HF_HOME > /test | |
| # Get secret GEMINI_1 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_1,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_1 > /test | |
| # Get secret GEMINI_2 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_2,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_2 > /test | |
| # Get secret GEMINI_3 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_3,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_3 > /test | |
| # Get secret GEMINI_4 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_4,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_4 > /test | |
| # Get secret GEMINI_5 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_5,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_5 > /test | |
| # Get secret GEMINI_6 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_6,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_6 > /test | |
| # Get secret GEMINI_7 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_7,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_7 > /test | |
| # Get secret GEMINI_8 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_8,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_8 > /test | |
| # Get secret GEMINI_9 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_9,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_9 > /test | |
| # Get secret GEMINI_10 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_10,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_10 > /test | |
| # Get secret GEMINI_11 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_11,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_11 > /test | |
| # Get secret GEMINI_SPARE_KEY_1 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_SPARE_KEY_1,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_SPARE_KEY_1 > /test | |
| # Get secret GEMINI_SPARE_KEY_2 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_SPARE_KEY_2,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_SPARE_KEY_2 > /test | |
| # Get secret GEMINI_SPARE_KEY_3 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_SPARE_KEY_3,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_SPARE_KEY_3 > /test | |
| # Get secret GEMINI_SPARE_KEY_4 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_SPARE_KEY_4,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_SPARE_KEY_4 > /test | |
| # Get secret GEMINI_SPARE_KEY_5 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=GEMINI_SPARE_KEY_5,mode=0444,required=true \ | |
| cat /run/secrets/GEMINI_SPARE_KEY_5 > /test | |
| # Get secret REDDIT_CLIENT_ID and output it to /test at buildtime | |
| RUN --mount=type=secret,id=REDDIT_CLIENT_ID,mode=0444,required=true \ | |
| cat /run/secrets/REDDIT_CLIENT_ID > /test | |
| # Get secret REDDIT_CLIENT_SECRET and output it to /test at buildtime | |
| RUN --mount=type=secret,id=REDDIT_CLIENT_SECRET,mode=0444,required=true \ | |
| cat /run/secrets/REDDIT_CLIENT_SECRET > /test | |
| # Get secret REDDIT_PASSWORD and output it to /test at buildtime | |
| RUN --mount=type=secret,id=REDDIT_PASSWORD,mode=0444,required=true \ | |
| cat /run/secrets/REDDIT_PASSWORD > /test | |
| # Get secret REDDIT_USER_AGENT and output it to /test at buildtime | |
| RUN --mount=type=secret,id=REDDIT_USER_AGENT,mode=0444,required=true \ | |
| cat /run/secrets/REDDIT_USER_AGENT > /test | |
| # Get secret REDDIT_USERNAME and output it to /test at buildtime | |
| RUN --mount=type=secret,id=REDDIT_USERNAME,mode=0444,required=true \ | |
| cat /run/secrets/REDDIT_USERNAME > /test | |
| # Get secret SUPABASE_URL and output it to /test at buildtime | |
| RUN --mount=type=secret,id=SUPABASE_URL,mode=0444,required=true \ | |
| cat /run/secrets/SUPABASE_URL > /test | |
| # Get secret SUPABASE_SERVICE_ROLE_KEY and output it to /test at buildtime | |
| RUN --mount=type=secret,id=SUPABASE_SERVICE_ROLE_KEY,mode=0444,required=true \ | |
| cat /run/secrets/SUPABASE_SERVICE_ROLE_KEY > /test | |
| # Get secret SCRAPERANT_APIKEY and output it to /test at buildtime | |
| RUN --mount=type=secret,id=SCRAPERANT_APIKEY,mode=0444,required=true \ | |
| cat /run/secrets/SCRAPERANT_APIKEY > /test | |
| # Get secret SCRAPERANT_APIKEY2 and output it to /test at buildtime | |
| RUN --mount=type=secret,id=SCRAPERANT_APIKEY2,mode=0444,required=true \ | |
| cat /run/secrets/SCRAPERANT_APIKEY2 > /test | |
| # Get secret ENVIRONMENT and output it to /test at buildtime | |
| RUN --mount=type=secret,id=ENVIRONMENT,mode=0444,required=true \ | |
| cat /run/secrets/ENVIRONMENT > /test | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| # ENV PATH="/home/user/.local/bin:$PATH" | |
| ENV HOME=/home/user \ | |
| PATH=/home/user/.local/bin:$PATH | |
| # WORKDIR /app | |
| WORKDIR $HOME/app | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # COPY --chown=user . /app | |
| COPY --chown=user . $HOME/app | |
| # # Make port 5000 available to the world outside this container | |
| # EXPOSE 8000 | |
| # Run main when the container launches | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"] |