droidFace / Dockerfile
sudo-soldier's picture
Update Dockerfile
2fe9a91 verified
raw
history blame
2.04 kB
FROM python:3.9-slim as backend
RUN apt-get update && apt-get install -y \
openjdk-11-jdk \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool \
&& wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.7.0.jar \
&& mv apktool_2.7.0.jar apktool.jar \
&& chmod +x apktool* \
&& mv apktool* /usr/local/bin/
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/app /app/app
FROM node:18 as frontend
WORKDIR /app
COPY frontend/package*.json .
RUN npm install
COPY frontend .
RUN npm run build
FROM python:3.9-slim
COPY --from=backend /usr/local/bin/apktool* /usr/local/bin/
COPY --from=backend /usr/lib/jvm /usr/lib/jvm
COPY --from=backend /app /app
COPY --from=frontend /app/build /app/frontend
WORKDIR /app
RUN pip install fastapi uvicorn python-multipart
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]FROM python:3.9-slim as backend
RUN apt-get update && apt-get install -y \
openjdk-11-jdk \
wget \
&& rm -rf /var/lib/apt/lists/*
RUN wget https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool \
&& wget https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.7.0.jar \
&& mv apktool_2.7.0.jar apktool.jar \
&& chmod +x apktool* \
&& mv apktool* /usr/local/bin/
WORKDIR /app
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY backend/app /app/app
FROM node:18 as frontend
WORKDIR /app
COPY frontend/package*.json .
RUN npm install
COPY frontend .
RUN npm run build
FROM python:3.9-slim
COPY --from=backend /usr/local/bin/apktool* /usr/local/bin/
COPY --from=backend /usr/lib/jvm /usr/lib/jvm
COPY --from=backend /app /app
COPY --from=frontend /app/build /app/frontend
WORKDIR /app
RUN pip install fastapi uvicorn python-multipart
EXPOSE 8000
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"]