feat: optimize Dockerfile for HuggingFace Spaces deployment
Browse files52 unmodified lines5354555657585937 unmodified lines9798991001011021034 unmodified lines10810911011111211311411511611711811928 unmodified lines14814915015115215333 unmodified lines18718818919019152 unmodified lines# Install build dependenciesRUN apt-get install -y --no-install-recommends \gcc g++ libc-dev libffi-devWORKDIR /app37 unmodified linesbcrypt \python-jose[cryptography] \passlib \python-multipart && \poetry config virtualenvs.create false && \poetry install --no-dev --no-interaction --no-ansi4 unmodified lines# Create non-root user and storage directoryRUN useradd -m -u 1000 user && \mkdir -p /storage && \chown -R user:user /storage# Install runtime dependenciesRUN apt-get install -y --no-install-recommends \nodejs npm libgmp-dev libmpfr-dev libmpc-dev && \pip install --no-cache-dir \gunicorn \gevent \28 unmodified linespython-jose[cryptography] \passlib \python-multipart \nltk && \python -m nltk.downloader punkt averaged_perceptron_tagger33 unmodified lines# HF Spaces uses port 7860EXPOSE 7860 3000WORKDIR /appCMD ["./entrypoint.sh"]52 unmodified lines53545556575859606137 unmodified lines991001011021031041051064 unmodified lines11111211311411511611711811912012112228 unmodified lines15115215315415515615733 unmodified lines19119219319419519619719852 unmodified lines# Install build dependenciesRUN apt-get install -y --no-install-recommends \gcc g++ libc-dev libffi-dev \libgmp-dev libmpfr-dev libmpc-dev \libssl-devWORKDIR /app37 unmodified linesbcrypt \python-jose[cryptography] \passlib \python-multipart \gmpy2 && \poetry config virtualenvs.create false && \poetry install --no-dev --no-interaction --no-ansi4 unmodified lines# Create non-root user and storage directoryRUN useradd -m -u 1000 user && \mkdir -p /storage/files /storage/cache /storage/logs && \chown -R user:user /storage# Install runtime dependenciesRUN apt-get install -y --no-install-recommends \nodejs npm libgmp-dev libmpfr-dev libmpc-dev libssl-dev && \pip install --no-cache-dir \gunicorn \gevent \28 unmodified linespython-jose[cryptography] \passlib \python-multipart \gmpy2 \nltk && \python -m nltk.downloader punkt averaged_perceptron_tagger33 unmodified lines# HF Spaces uses port 7860EXPOSE 7860 3000# Set up storage volumesVOLUME ["/storage/files", "/storage/cache", "/storage/logs"]WORKDIR /appCMD ["./entrypoint.sh"]
Dockerfile+11-4