| |
| FROM node:20-slim AS frontend-builder |
| WORKDIR /app/frontend |
| COPY frontend/package*.json ./ |
| RUN npm install |
| COPY frontend/ ./ |
| RUN npm run build |
|
|
| |
| FROM ubuntu:22.04 |
| ENV DEBIAN_FRONTEND=noninteractive |
|
|
| |
| RUN apt-get update && apt-get install -y \ |
| openjdk-17-jdk \ |
| python3 \ |
| python3-pip \ |
| zipalign \ |
| apksigner \ |
| wget \ |
| && rm -rf /var/lib/apt/lists/* |
|
|
| |
| RUN wget -q https://github.com/iBotPeaches/Apktool/releases/download/v2.9.3/apktool_2.9.3.jar -O /usr/local/bin/apktool.jar \ |
| && chmod +x /usr/local/bin/apktool.jar |
|
|
| |
| RUN useradd -m -u 1000 phantomuser |
| USER phantomuser |
| ENV HOME=/home/phantomuser \ |
| PATH=/home/phantomuser/.local/bin:$PATH |
|
|
| WORKDIR $HOME/app |
|
|
| |
| COPY --chown=phantomuser:phantomuser requirements.txt . |
| RUN pip3 install --no-cache-dir -r requirements.txt |
|
|
| |
| RUN keytool -genkey -v -keystore phantom.jks -alias phantom -keyalg RSA -keysize 2048 -validity 10000 \ |
| -storepass phantom_secure -keypass phantom_secure -dname "CN=Phantom, OU=Project, O=Phantom, L=Cyberspace, ST=Global, C=XX" |
|
|
| |
| COPY --chown=phantomuser:phantomuser patcher.py . |
| COPY --chown=phantomuser:phantomuser main.py . |
| COPY --chown=phantomuser:phantomuser regex_config.json . |
| COPY --chown=phantomuser:phantomuser regex_anuncios.txt . |
| COPY --chown=phantomuser:phantomuser regex_parser.py . |
|
|
| |
| COPY --from=frontend-builder --chown=phantomuser:phantomuser /app/frontend/dist ./frontend/dist |
|
|
| |
| RUN mkdir -p uploads downloads phantom_workspace |
|
|
| EXPOSE 7860 |
|
|
| CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860", "--ws-ping-interval", "20", "--ws-ping-timeout", "30"] |
|
|