FROM intelligencenoborders/scinobo-taxonomy-mapper:v0.1.0 # Copy files COPY download_model.py /app RUN useradd -m -u 1000 user RUN chown -R user /app USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Run the download RUN python /app/download_model.py # download nltk punkt and stopwords RUN python3 -c "import nltk; nltk.download('punkt'); nltk.download('stopwords')" # Set the working directory in the container WORKDIR /app/src # Expose the port that Gradio will run on EXPOSE 7860 RUN --mount=type=secret,id=API_IP,mode=0444,required=true RUN --mount=type=secret,id=API_PORT,mode=0444,required=true RUN --mount=type=secret,id=API_ENDPOINT,mode=0444,required=true RUN $(cat /run/secrets/API_IP) RUN $(cat /run/secrets/API_PORT) RUN $(cat /run/secrets/API_ENDPOINT) ENV PYTHONUNBUFFERED=1 \ GRADIO_ALLOW_FLAGGING=never \ GRADIO_NUM_PORTS=1 \ GRADIO_SERVER_NAME=0.0.0.0 \ SYSTEM=spaces # Run app.py when the container launches CMD ["python", "-m", "fos_mapper.server.gradio_app"]