Spaces:
Paused
Paused
| FROM node:20-bullseye | |
| ENV DEBIAN_FRONTEND=noninteractive | |
| # 1. Install system dependencies including GIT | |
| RUN apt-get update && apt-get install -y \ | |
| fonts-noto \ | |
| software-properties-common \ | |
| speedtest-cli \ | |
| libcairo2-dev \ | |
| libpango1.0-dev \ | |
| libjpeg-dev \ | |
| libgif-dev \ | |
| librsvg2-dev \ | |
| pkg-config \ | |
| build-essential \ | |
| python3 \ | |
| ffmpeg \ | |
| libnspr4 \ | |
| libnss3 \ | |
| libatk1.0-0 \ | |
| libatk-bridge2.0-0 \ | |
| libcups2 \ | |
| libdrm2 \ | |
| libxkbcommon0 \ | |
| libxcomposite1 \ | |
| libxdamage1 \ | |
| libxfixes3 \ | |
| libxrandr2 \ | |
| libgbm1 \ | |
| libasound2 \ | |
| libpangocairo-1.0-0 \ | |
| libpango-1.0-0 \ | |
| libcairo2 \ | |
| libgtk-3-0 \ | |
| fonts-liberation \ | |
| ca-certificates \ | |
| curl \ | |
| unzip \ | |
| && fc-cache -f -v \ | |
| && apt-get clean \ | |
| && rm -rf /var/lib/apt/lists/* | |
| # Install Xray-core for VMess/VLESS/Shadowsocks support | |
| RUN curl -L https://github.com/XTLS/Xray-core/releases/latest/download/Xray-linux-64.zip -o xray.zip \ | |
| && unzip xray.zip xray -d /usr/local/bin/ \ | |
| && chmod +x /usr/local/bin/xray \ | |
| && rm xray.zip | |
| WORKDIR /api | |
| ARG CACHE_BUST=1 | |
| # 2. Clone the repository directly into the /api folder | |
| RUN git clone https://github.com/alexainc/alexa-v3 . | |
| # 3. Install Node.js dependencies | |
| RUN npm install --legacy-peer-deps | |
| # 4. Rebuild native modules | |
| RUN npm rebuild canvas sharp --force | |
| RUN rm -rf auth5a && mkdir -p auth5a | |
| EXPOSE 8000 | |
| # 5. Runtime Script to handle the SSN secret and start the app | |
| # This creates the creds.json from the $SSN env variable at startup | |
| # 5. Runtime Script: Check if SSN exists, write it, then start node | |
| CMD if [ -n "$SSN" ]; then \ | |
| echo "$SSN" > ./auth5a/creds.json; \ | |
| echo "SSN variable loaded successfully."; \ | |
| else \ | |
| echo "WARNING: SSN variable is not set!"; \ | |
| fi && \ | |
| node app.js | |
| # Note: Check if your main entry file is 'app.js' or 'index.js'. |